@algolia/recommend 5.0.0-alpha.11 → 5.0.0-alpha.110

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 (322) hide show
  1. package/dist/builds/browser.d.ts +23 -5
  2. package/dist/builds/browser.d.ts.map +1 -1
  3. package/dist/builds/node.d.ts +23 -5
  4. package/dist/builds/node.d.ts.map +1 -1
  5. package/dist/model/advancedSyntaxFeatures.d.ts +1 -1
  6. package/dist/model/advancedSyntaxFeatures.d.ts.map +1 -1
  7. package/dist/model/alternativesAsExact.d.ts +1 -1
  8. package/dist/model/alternativesAsExact.d.ts.map +1 -1
  9. package/dist/model/anchoring.d.ts +5 -0
  10. package/dist/model/anchoring.d.ts.map +1 -0
  11. package/dist/model/aroundPrecision.d.ts +6 -0
  12. package/dist/model/aroundPrecision.d.ts.map +1 -0
  13. package/dist/model/aroundPrecisionFromValueInner.d.ts +14 -0
  14. package/dist/model/aroundPrecisionFromValueInner.d.ts.map +1 -0
  15. package/dist/model/aroundRadius.d.ts +5 -5
  16. package/dist/model/aroundRadius.d.ts.map +1 -1
  17. package/dist/model/aroundRadiusAll.d.ts +4 -1
  18. package/dist/model/aroundRadiusAll.d.ts.map +1 -1
  19. package/dist/model/automaticFacetFilter.d.ts +18 -0
  20. package/dist/model/automaticFacetFilter.d.ts.map +1 -0
  21. package/dist/model/automaticFacetFilters.d.ts +6 -0
  22. package/dist/model/automaticFacetFilters.d.ts.map +1 -0
  23. package/dist/model/baseRecommendRequest.d.ts +14 -17
  24. package/dist/model/baseRecommendRequest.d.ts.map +1 -1
  25. package/dist/model/baseRecommendationsQuery.d.ts +12 -0
  26. package/dist/model/baseRecommendationsQuery.d.ts.map +1 -0
  27. package/dist/model/baseRecommendedForYouQuery.d.ts +8 -0
  28. package/dist/model/baseRecommendedForYouQuery.d.ts.map +1 -0
  29. package/dist/model/baseRecommendedForYouQueryParameters.d.ts +7 -0
  30. package/dist/model/baseRecommendedForYouQueryParameters.d.ts.map +1 -0
  31. package/dist/model/baseSearchParams.d.ts +3 -3
  32. package/dist/model/baseSearchParams.d.ts.map +1 -1
  33. package/dist/model/baseSearchParamsWithoutQuery.d.ts +114 -122
  34. package/dist/model/baseSearchParamsWithoutQuery.d.ts.map +1 -1
  35. package/dist/model/baseSearchResponse.d.ts +109 -101
  36. package/dist/model/baseSearchResponse.d.ts.map +1 -1
  37. package/dist/model/baseTrendingFacetsQuery.d.ts +9 -0
  38. package/dist/model/baseTrendingFacetsQuery.d.ts.map +1 -0
  39. package/dist/model/baseTrendingItemsQuery.d.ts +16 -0
  40. package/dist/model/baseTrendingItemsQuery.d.ts.map +1 -0
  41. package/dist/model/clientMethodProps.d.ts +127 -60
  42. package/dist/model/clientMethodProps.d.ts.map +1 -1
  43. package/dist/model/condition.d.ts +21 -0
  44. package/dist/model/condition.d.ts.map +1 -0
  45. package/dist/model/consequence.d.ts +26 -0
  46. package/dist/model/consequence.d.ts.map +1 -0
  47. package/dist/model/consequenceHide.d.ts +10 -0
  48. package/dist/model/consequenceHide.d.ts.map +1 -0
  49. package/dist/model/consequenceParams.d.ts +5 -0
  50. package/dist/model/consequenceParams.d.ts.map +1 -0
  51. package/dist/model/consequenceQuery.d.ts +6 -0
  52. package/dist/model/consequenceQuery.d.ts.map +1 -0
  53. package/dist/model/consequenceQueryObject.d.ts +12 -0
  54. package/dist/model/consequenceQueryObject.d.ts.map +1 -0
  55. package/dist/model/deletedAtResponse.d.ts +14 -0
  56. package/dist/model/deletedAtResponse.d.ts.map +1 -0
  57. package/dist/model/distinct.d.ts +4 -4
  58. package/dist/model/distinct.d.ts.map +1 -1
  59. package/dist/model/edit.d.ts +13 -0
  60. package/dist/model/edit.d.ts.map +1 -0
  61. package/dist/model/editType.d.ts +5 -0
  62. package/dist/model/editType.d.ts.map +1 -0
  63. package/dist/model/errorBase.d.ts +6 -6
  64. package/dist/model/errorBase.d.ts.map +1 -1
  65. package/dist/model/exactOnSingleWordQuery.d.ts +4 -4
  66. package/dist/model/exactOnSingleWordQuery.d.ts.map +1 -1
  67. package/dist/model/exhaustive.d.ts +26 -0
  68. package/dist/model/exhaustive.d.ts.map +1 -0
  69. package/dist/model/facetFilters.d.ts +5 -5
  70. package/dist/model/facetFilters.d.ts.map +1 -1
  71. package/dist/model/facetOrdering.d.ts +12 -12
  72. package/dist/model/facetOrdering.d.ts.map +1 -1
  73. package/dist/model/facets.d.ts +9 -9
  74. package/dist/model/facets.d.ts.map +1 -1
  75. package/dist/model/facetsStats.d.ts +18 -18
  76. package/dist/model/facetsStats.d.ts.map +1 -1
  77. package/dist/model/getRecommendTaskResponse.d.ts +5 -0
  78. package/dist/model/getRecommendTaskResponse.d.ts.map +1 -0
  79. package/dist/model/getRecommendationsParams.d.ts +10 -10
  80. package/dist/model/getRecommendationsParams.d.ts.map +1 -1
  81. package/dist/model/getRecommendationsResponse.d.ts +4 -4
  82. package/dist/model/getRecommendationsResponse.d.ts.map +1 -1
  83. package/dist/model/highlightResult.d.ts +2 -2
  84. package/dist/model/highlightResult.d.ts.map +1 -1
  85. package/dist/model/highlightResultOption.d.ts +19 -19
  86. package/dist/model/highlightResultOption.d.ts.map +1 -1
  87. package/dist/model/ignorePlurals.d.ts +5 -4
  88. package/dist/model/ignorePlurals.d.ts.map +1 -1
  89. package/dist/model/index.d.ts +95 -53
  90. package/dist/model/index.d.ts.map +1 -1
  91. package/dist/model/indexSettingsAsSearchParams.d.ts +159 -160
  92. package/dist/model/indexSettingsAsSearchParams.d.ts.map +1 -1
  93. package/dist/model/matchLevel.d.ts +4 -4
  94. package/dist/model/matchLevel.d.ts.map +1 -1
  95. package/dist/model/matchedGeoLocation.d.ts +14 -14
  96. package/dist/model/matchedGeoLocation.d.ts.map +1 -1
  97. package/dist/model/mixedSearchFilters.d.ts +1 -1
  98. package/dist/model/mixedSearchFilters.d.ts.map +1 -1
  99. package/dist/model/mode.d.ts +5 -0
  100. package/dist/model/mode.d.ts.map +1 -0
  101. package/dist/model/numericFilters.d.ts +5 -5
  102. package/dist/model/numericFilters.d.ts.map +1 -1
  103. package/dist/model/optionalFilters.d.ts +5 -5
  104. package/dist/model/optionalFilters.d.ts.map +1 -1
  105. package/dist/model/params.d.ts +13 -0
  106. package/dist/model/params.d.ts.map +1 -0
  107. package/dist/model/personalization.d.ts +14 -14
  108. package/dist/model/personalization.d.ts.map +1 -1
  109. package/dist/model/promote.d.ts +4 -0
  110. package/dist/model/promote.d.ts.map +1 -0
  111. package/dist/model/promoteObjectID.d.ts +14 -0
  112. package/dist/model/promoteObjectID.d.ts.map +1 -0
  113. package/dist/model/promoteObjectIDs.d.ts +14 -0
  114. package/dist/model/promoteObjectIDs.d.ts.map +1 -0
  115. package/dist/model/queryType.d.ts +4 -4
  116. package/dist/model/queryType.d.ts.map +1 -1
  117. package/dist/model/rankingInfo.d.ts +53 -50
  118. package/dist/model/rankingInfo.d.ts.map +1 -1
  119. package/dist/model/reRankingApplyFilter.d.ts +5 -5
  120. package/dist/model/reRankingApplyFilter.d.ts.map +1 -1
  121. package/dist/model/recommendHit.d.ts +26 -26
  122. package/dist/model/recommendHit.d.ts.map +1 -1
  123. package/dist/model/recommendModels.d.ts +2 -0
  124. package/dist/model/recommendModels.d.ts.map +1 -0
  125. package/dist/model/recommendationModels.d.ts +4 -4
  126. package/dist/model/recommendationModels.d.ts.map +1 -1
  127. package/dist/model/recommendationsHit.d.ts +4 -0
  128. package/dist/model/recommendationsHit.d.ts.map +1 -0
  129. package/dist/model/recommendationsHits.d.ts +13 -0
  130. package/dist/model/recommendationsHits.d.ts.map +1 -0
  131. package/dist/model/recommendationsQuery.d.ts +4 -0
  132. package/dist/model/recommendationsQuery.d.ts.map +1 -0
  133. package/dist/model/recommendationsRequest.d.ts +5 -3
  134. package/dist/model/recommendationsRequest.d.ts.map +1 -1
  135. package/dist/model/recommendationsResults.d.ts +4 -0
  136. package/dist/model/recommendationsResults.d.ts.map +1 -0
  137. package/dist/model/recommendedForYouModel.d.ts +5 -0
  138. package/dist/model/recommendedForYouModel.d.ts.map +1 -0
  139. package/dist/model/recommendedForYouQuery.d.ts +4 -0
  140. package/dist/model/recommendedForYouQuery.d.ts.map +1 -0
  141. package/dist/model/recommendedForYouQueryParameters.d.ts +4 -0
  142. package/dist/model/recommendedForYouQueryParameters.d.ts.map +1 -0
  143. package/dist/model/redirect.d.ts +8 -0
  144. package/dist/model/redirect.d.ts.map +1 -0
  145. package/dist/model/redirectRuleIndexMetadata.d.ts +21 -0
  146. package/dist/model/redirectRuleIndexMetadata.d.ts.map +1 -0
  147. package/dist/model/redirectRuleIndexMetadataData.d.ts +7 -0
  148. package/dist/model/redirectRuleIndexMetadataData.d.ts.map +1 -0
  149. package/dist/model/removeStopWords.d.ts +5 -4
  150. package/dist/model/removeStopWords.d.ts.map +1 -1
  151. package/dist/model/removeWordsIfNoResults.d.ts +4 -4
  152. package/dist/model/removeWordsIfNoResults.d.ts.map +1 -1
  153. package/dist/model/renderingContent.d.ts +7 -7
  154. package/dist/model/renderingContent.d.ts.map +1 -1
  155. package/dist/model/ruleResponse.d.ts +27 -0
  156. package/dist/model/ruleResponse.d.ts.map +1 -0
  157. package/dist/model/ruleResponseMetadata.d.ts +7 -0
  158. package/dist/model/ruleResponseMetadata.d.ts.map +1 -0
  159. package/dist/model/searchParamsObject.d.ts +3 -3
  160. package/dist/model/searchParamsObject.d.ts.map +1 -1
  161. package/dist/model/searchParamsQuery.d.ts +6 -6
  162. package/dist/model/searchParamsQuery.d.ts.map +1 -1
  163. package/dist/model/searchRecommendRulesParams.d.ts +26 -0
  164. package/dist/model/searchRecommendRulesParams.d.ts.map +1 -0
  165. package/dist/model/searchRecommendRulesResponse.d.ts +20 -0
  166. package/dist/model/searchRecommendRulesResponse.d.ts.map +1 -0
  167. package/dist/model/semanticSearch.d.ts +10 -0
  168. package/dist/model/semanticSearch.d.ts.map +1 -0
  169. package/dist/model/snippetResult.d.ts +2 -2
  170. package/dist/model/snippetResult.d.ts.map +1 -1
  171. package/dist/model/snippetResultOption.d.ts +11 -11
  172. package/dist/model/snippetResultOption.d.ts.map +1 -1
  173. package/dist/model/sortRemainingBy.d.ts +4 -4
  174. package/dist/model/sortRemainingBy.d.ts.map +1 -1
  175. package/dist/model/supportedLanguage.d.ts +5 -0
  176. package/dist/model/supportedLanguage.d.ts.map +1 -0
  177. package/dist/model/tagFilters.d.ts +5 -5
  178. package/dist/model/tagFilters.d.ts.map +1 -1
  179. package/dist/model/taskStatus.d.ts +5 -0
  180. package/dist/model/taskStatus.d.ts.map +1 -0
  181. package/dist/model/trendingFacetHit.d.ts +18 -0
  182. package/dist/model/trendingFacetHit.d.ts.map +1 -0
  183. package/dist/model/trendingFacetsModel.d.ts +5 -0
  184. package/dist/model/trendingFacetsModel.d.ts.map +1 -0
  185. package/dist/model/trendingFacetsQuery.d.ts +4 -0
  186. package/dist/model/trendingFacetsQuery.d.ts.map +1 -0
  187. package/dist/model/trendingItemsModel.d.ts +5 -0
  188. package/dist/model/trendingItemsModel.d.ts.map +1 -0
  189. package/dist/model/trendingItemsQuery.d.ts +4 -0
  190. package/dist/model/trendingItemsQuery.d.ts.map +1 -0
  191. package/dist/model/typoTolerance.d.ts +5 -5
  192. package/dist/model/typoTolerance.d.ts.map +1 -1
  193. package/dist/model/typoToleranceEnum.d.ts +4 -1
  194. package/dist/model/typoToleranceEnum.d.ts.map +1 -1
  195. package/dist/model/value.d.ts +8 -8
  196. package/dist/model/value.d.ts.map +1 -1
  197. package/dist/recommend.cjs +390 -0
  198. package/dist/recommend.esm.browser.js +589 -475
  199. package/dist/recommend.esm.node.js +379 -235
  200. package/dist/recommend.umd.js +2 -2
  201. package/dist/src/recommendClient.d.ts +131 -81
  202. package/dist/src/recommendClient.d.ts.map +1 -1
  203. package/index.js +1 -1
  204. package/model/advancedSyntaxFeatures.ts +1 -1
  205. package/model/alternativesAsExact.ts +1 -1
  206. package/model/anchoring.ts +6 -0
  207. package/model/aroundPrecision.ts +8 -0
  208. package/model/aroundPrecisionFromValueInner.ts +16 -0
  209. package/model/aroundRadius.ts +2 -2
  210. package/model/aroundRadiusAll.ts +4 -1
  211. package/model/automaticFacetFilter.ts +21 -0
  212. package/model/automaticFacetFilters.ts +8 -0
  213. package/model/baseRecommendRequest.ts +5 -11
  214. package/model/baseRecommendationsQuery.ts +17 -0
  215. package/model/baseRecommendedForYouQuery.ts +12 -0
  216. package/model/baseRecommendedForYouQueryParameters.ts +8 -0
  217. package/model/baseSearchParams.ts +1 -1
  218. package/model/baseSearchParamsWithoutQuery.ts +36 -46
  219. package/model/baseSearchResponse.ts +42 -31
  220. package/model/baseTrendingFacetsQuery.ts +12 -0
  221. package/model/baseTrendingItemsQuery.ts +22 -0
  222. package/model/clientMethodProps.ts +91 -19
  223. package/model/condition.ts +27 -0
  224. package/model/consequence.ts +32 -0
  225. package/model/consequenceHide.ts +11 -0
  226. package/model/consequenceParams.ts +9 -0
  227. package/model/consequenceQuery.ts +8 -0
  228. package/model/consequenceQueryObject.ts +15 -0
  229. package/model/deletedAtResponse.ts +16 -0
  230. package/model/distinct.ts +2 -2
  231. package/model/edit.ts +17 -0
  232. package/model/editType.ts +6 -0
  233. package/model/errorBase.ts +1 -1
  234. package/model/exactOnSingleWordQuery.ts +2 -2
  235. package/model/exhaustive.ts +31 -0
  236. package/model/facetFilters.ts +2 -2
  237. package/model/facetOrdering.ts +3 -3
  238. package/model/facets.ts +3 -3
  239. package/model/facetsStats.ts +5 -5
  240. package/model/getRecommendTaskResponse.ts +7 -0
  241. package/model/getRecommendationsParams.ts +3 -3
  242. package/model/getRecommendationsResponse.ts +3 -3
  243. package/model/highlightResult.ts +5 -2
  244. package/model/highlightResultOption.ts +4 -4
  245. package/model/ignorePlurals.ts +5 -3
  246. package/model/index.ts +50 -8
  247. package/model/indexSettingsAsSearchParams.ts +54 -54
  248. package/model/matchLevel.ts +2 -2
  249. package/model/matchedGeoLocation.ts +1 -1
  250. package/model/mixedSearchFilters.ts +1 -1
  251. package/model/mode.ts +6 -0
  252. package/model/numericFilters.ts +2 -2
  253. package/model/optionalFilters.ts +2 -2
  254. package/model/params.ts +18 -0
  255. package/model/personalization.ts +1 -1
  256. package/model/promote.ts +6 -0
  257. package/model/promoteObjectID.ts +16 -0
  258. package/model/promoteObjectIDs.ts +16 -0
  259. package/model/queryType.ts +2 -2
  260. package/model/rankingInfo.ts +11 -8
  261. package/model/reRankingApplyFilter.ts +2 -2
  262. package/model/recommendHit.ts +6 -6
  263. package/model/recommendModels.ts +7 -0
  264. package/model/recommendationModels.ts +2 -2
  265. package/model/recommendationsHit.ts +6 -0
  266. package/model/recommendationsHits.ts +17 -0
  267. package/model/recommendationsQuery.ts +7 -0
  268. package/model/recommendationsRequest.ts +10 -4
  269. package/model/recommendationsResults.ts +6 -0
  270. package/model/recommendedForYouModel.ts +6 -0
  271. package/model/recommendedForYouQuery.ts +7 -0
  272. package/model/recommendedForYouQueryParameters.ts +7 -0
  273. package/model/redirect.ts +10 -0
  274. package/model/redirectRuleIndexMetadata.ts +27 -0
  275. package/model/redirectRuleIndexMetadataData.ts +8 -0
  276. package/model/removeStopWords.ts +5 -3
  277. package/model/removeWordsIfNoResults.ts +2 -2
  278. package/model/renderingContent.ts +2 -2
  279. package/model/ruleResponse.ts +34 -0
  280. package/model/ruleResponseMetadata.ts +8 -0
  281. package/model/searchParamsObject.ts +1 -1
  282. package/model/searchParamsQuery.ts +2 -2
  283. package/model/searchRecommendRulesParams.ts +31 -0
  284. package/model/searchRecommendRulesResponse.ts +25 -0
  285. package/model/semanticSearch.ts +11 -0
  286. package/model/snippetResult.ts +5 -2
  287. package/model/snippetResultOption.ts +3 -3
  288. package/model/sortRemainingBy.ts +2 -2
  289. package/model/supportedLanguage.ts +74 -0
  290. package/model/tagFilters.ts +2 -2
  291. package/model/taskStatus.ts +6 -0
  292. package/model/trendingFacetHit.ts +21 -0
  293. package/model/trendingFacetsModel.ts +6 -0
  294. package/model/trendingFacetsQuery.ts +7 -0
  295. package/model/trendingItemsModel.ts +6 -0
  296. package/model/trendingItemsQuery.ts +6 -0
  297. package/model/typoTolerance.ts +2 -2
  298. package/model/typoToleranceEnum.ts +4 -1
  299. package/model/value.ts +2 -2
  300. package/package.json +10 -9
  301. package/dist/model/baseRecommendationRequest.d.ts +0 -9
  302. package/dist/model/baseRecommendationRequest.d.ts.map +0 -1
  303. package/dist/model/baseTrendingRequest.d.ts +0 -13
  304. package/dist/model/baseTrendingRequest.d.ts.map +0 -1
  305. package/dist/model/recommendHits.d.ts +0 -5
  306. package/dist/model/recommendHits.d.ts.map +0 -1
  307. package/dist/model/recommendationRequest.d.ts +0 -4
  308. package/dist/model/recommendationRequest.d.ts.map +0 -1
  309. package/dist/model/recommendationsResponse.d.ts +0 -4
  310. package/dist/model/recommendationsResponse.d.ts.map +0 -1
  311. package/dist/model/trendingModels.d.ts +0 -5
  312. package/dist/model/trendingModels.d.ts.map +0 -1
  313. package/dist/model/trendingRequest.d.ts +0 -4
  314. package/dist/model/trendingRequest.d.ts.map +0 -1
  315. package/dist/recommend.cjs.js +0 -248
  316. package/model/baseRecommendationRequest.ts +0 -12
  317. package/model/baseTrendingRequest.ts +0 -17
  318. package/model/recommendHits.ts +0 -7
  319. package/model/recommendationRequest.ts +0 -7
  320. package/model/recommendationsResponse.ts +0 -6
  321. package/model/trendingModels.ts +0 -6
  322. package/model/trendingRequest.ts +0 -6
@@ -1,2 +1,2 @@
1
- /*! recommend.umd.js | 5.0.0-alpha.11 | © Algolia, inc. | https://github.com/algolia/algoliasearch-client-javascript */
2
- !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self)["@algolia/recommend"]={})}(this,(function(e){"use strict";function t(e){let t;const r=`algolia-client-js-${e.key}`;function s(){return void 0===t&&(t=e.localStorage||window.localStorage),t}function a(){return JSON.parse(s().getItem(r)||"{}")}return{get:(e,t,r={miss:()=>Promise.resolve()})=>Promise.resolve().then((()=>{const r=JSON.stringify(e),s=a()[r];return Promise.all([s||t(),void 0!==s])})).then((([e,t])=>Promise.all([e,t||r.miss(e)]))).then((([e])=>e)),set:(e,t)=>Promise.resolve().then((()=>{const o=a();return o[JSON.stringify(e)]=t,s().setItem(r,JSON.stringify(o)),t})),delete:e=>Promise.resolve().then((()=>{const t=a();delete t[JSON.stringify(e)],s().setItem(r,JSON.stringify(t))})),clear:()=>Promise.resolve().then((()=>{s().removeItem(r)}))}}function r(e){const t=[...e.caches],s=t.shift();return void 0===s?{get:(e,t,r={miss:()=>Promise.resolve()})=>t().then((e=>Promise.all([e,r.miss(e)]))).then((([e])=>e)),set:(e,t)=>Promise.resolve(t),delete:e=>Promise.resolve(),clear:()=>Promise.resolve()}:{get:(e,a,o={miss:()=>Promise.resolve()})=>s.get(e,a,o).catch((()=>r({caches:t}).get(e,a,o))),set:(e,a)=>s.set(e,a).catch((()=>r({caches:t}).set(e,a))),delete:e=>s.delete(e).catch((()=>r({caches:t}).delete(e))),clear:()=>s.clear().catch((()=>r({caches:t}).clear()))}}function s(e={serializable:!0}){let t={};return{get(r,s,a={miss:()=>Promise.resolve()}){const o=JSON.stringify(r);if(o in t)return Promise.resolve(e.serializable?JSON.parse(t[o]):t[o]);const n=s();return n.then((e=>a.miss(e))).then((()=>n))},set:(r,s)=>(t[JSON.stringify(r)]=e.serializable?JSON.stringify(s):s,Promise.resolve(s)),delete:e=>(delete t[JSON.stringify(e)],Promise.resolve()),clear:()=>(t={},Promise.resolve())}}const a=12e4;function o(e,t="up"){const r=Date.now();return{...e,status:t,lastUpdate:r,isUp:function(){return"up"===t||Date.now()-r>a},isTimedOut:function(){return"timed out"===t&&Date.now()-r<=a}}}function n(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class i extends Error{constructor(e,t){super(e),n(this,"name","AlgoliaError"),t&&(this.name=t)}}class c extends i{constructor(e,t,r){super(e,r),n(this,"stackTrace",void 0),this.stackTrace=t}}class u extends c{constructor(e){super("Unreachable hosts - your application id may be incorrect. If the error persists, contact support@algolia.com.",e,"RetryError")}}class l extends c{constructor(e,t,r){super(e,r,"ApiError"),n(this,"status",void 0),this.status=t}}class d extends i{constructor(e,t){super(e,"DeserializationError"),n(this,"response",void 0),this.response=t}}function h(e,t,r){const s=function(e){const t=e=>"[object Object]"===Object.prototype.toString.call(e)||"[object Array]"===Object.prototype.toString.call(e);return Object.keys(e).map((r=>`${r}=${t(e[r])?JSON.stringify(e[r]):e[r]}`)).join("&")}(r);let a=`${e.protocol}://${e.url}/${"/"===t.charAt(0)?t.substr(1):t}`;return s.length&&(a+=`?${s}`),a}function m(e){const t=e.request.headers["x-algolia-api-key"]?{"x-algolia-api-key":"*****"}:{};return{...e,request:{...e.request,headers:{...e.request.headers,...t}}}}function p({hosts:e,hostsCache:t,baseHeaders:r,baseQueryParameters:s,algoliaAgent:a,timeouts:n,requester:i,requestsCache:c,responsesCache:p}){async function g(c,p,g=!0){const f=[],y=function(e,t){if("GET"===e.method||void 0===e.data&&void 0===t.data)return;const r=Array.isArray(e.data)?e.data:{...e.data,...t.data};return JSON.stringify(r)}(c,p),P=function(e,t,r){const s={Accept:"application/json",...e,...t,...r},a={};return Object.keys(s).forEach((e=>{const t=s[e];a[e.toLowerCase()]=t})),a}(r,c.headers,p.headers),w="GET"===c.method?{...c.data,...p.data}:{},q={...s,...c.queryParameters,...w};if(a.value&&(q["x-algolia-agent"]=a.value),p&&p.queryParameters)for(const e of Object.keys(p.queryParameters))p.queryParameters[e]&&"[object Object]"!==Object.prototype.toString.call(p.queryParameters[e])?q[e]=p.queryParameters[e].toString():q[e]=p.queryParameters[e];let v=0;const b=async(e,r)=>{const s=e.pop();if(void 0===s)throw new u(function(e){return e.map((e=>m(e)))}(f));let a=p.timeout;void 0===a&&(a=g?n.read:n.write);const w={data:y,headers:P,method:c.method,url:h(s,c.path,q),connectTimeout:r(v,n.connect),responseTimeout:r(v,a)},O=t=>{const r={request:w,response:t,host:s,triesLeft:e.length};return f.push(r),r},T=await i.send(w);if(function({isTimedOut:e,status:t}){return e||function({isTimedOut:e,status:t}){return!e&&0==~~t}({isTimedOut:e,status:t})||2!=~~(t/100)&&4!=~~(t/100)}(T)){const a=O(T);return T.isTimedOut&&v++,console.log("Retryable failure",m(a)),await t.set(s,o(s,T.isTimedOut?"timed out":"down")),b(e,r)}if(function({status:e}){return 2==~~(e/100)}(T))return function(e){try{return JSON.parse(e.content)}catch(t){throw new d(t.message,e)}}(T);throw O(T),function({content:e,status:t},r){let s=e;try{s=JSON.parse(e).message}catch(e){}return new l(s,t,r)}(T,f)},O=e.filter((e=>"readWrite"===e.accept||(g?"read"===e.accept:"write"===e.accept))),T=await async function(e){const r=await Promise.all(e.map((e=>t.get(e,(()=>Promise.resolve(o(e))))))),s=r.filter((e=>e.isUp())),a=r.filter((e=>e.isTimedOut())),n=[...s,...a];return{hosts:n.length>0?n:e,getTimeout:(e,t)=>(0===a.length&&0===e?1:a.length+3+e)*t}}(O);return b([...T.hosts].reverse(),T.getTimeout)}return{hostsCache:t,requester:i,timeouts:n,algoliaAgent:a,baseHeaders:r,baseQueryParameters:s,hosts:e,request:function(e,t={}){const a=e.useReadTransporter||"GET"===e.method;if(!a)return g(e,t,a);const o=()=>g(e,t);if(!0!==(t.cacheable||e.cacheable))return o();const n={request:e,requestOptions:t,transporter:{queryParameters:s,headers:r}};return p.get(n,(()=>c.get(n,(()=>c.set(n,o()).then((e=>Promise.all([c.delete(n),e])),(e=>Promise.all([c.delete(n),Promise.reject(e)]))).then((([e,t])=>t))))),{miss:e=>p.set(n,e)})},requestsCache:c,responsesCache:p}}function g({algoliaAgents:e,client:t,version:r}){const s=function(e){const t={value:`Algolia for JavaScript (${e})`,add(e){const r=`; ${e.segment}${void 0!==e.version?` (${e.version})`:""}`;return-1===t.value.indexOf(r)&&(t.value=`${t.value}${r}`),t}};return t}(r).add({segment:t,version:r});return e.forEach((e=>s.add(e))),s}const f="5.0.0-alpha.11";function y(e){return[{url:`${e}-dsn.algolia.net`,accept:"read",protocol:"https"},{url:`${e}.algolia.net`,accept:"write",protocol:"https"}].concat(function(e){const t=e;for(let r=e.length-1;r>0;r--){const s=Math.floor(Math.random()*(r+1)),a=e[r];t[r]=e[s],t[s]=a}return t}([{url:`${e}-1.algolianet.com`,accept:"readWrite",protocol:"https"},{url:`${e}-2.algolianet.com`,accept:"readWrite",protocol:"https"},{url:`${e}-3.algolianet.com`,accept:"readWrite",protocol:"https"}]))}e.apiClientVersion=f,e.recommendClient=function(e,a,o){if(!e||"string"!=typeof e)throw new Error("`appId` is missing.");if(!a||"string"!=typeof a)throw new Error("`apiKey` is missing.");return function({appId:e,apiKey:t,authMode:r,algoliaAgents:s,...a}){const o=function(e,t,r="WithinHeaders"){const s={"x-algolia-api-key":t,"x-algolia-application-id":e};return{headers:()=>"WithinHeaders"===r?s:{},queryParameters:()=>"WithinQueryParameters"===r?s:{}}}(e,t,r),n=p({hosts:y(e),...a,algoliaAgent:g({algoliaAgents:s,client:"Recommend",version:f}),baseHeaders:{"content-type":"text/plain",...o.headers(),...a.baseHeaders},baseQueryParameters:{...o.queryParameters(),...a.baseQueryParameters}});return{transporter:n,appId:e,clearCache:()=>Promise.all([n.requestsCache.clear(),n.responsesCache.clear()]).then((()=>{})),get _ua(){return n.algoliaAgent.value},addAlgoliaAgent(e,t){n.algoliaAgent.add({segment:e,version:t})},del({path:e,parameters:t},r){if(!e)throw new Error("Parameter `path` is required when calling `del`.");const s={method:"DELETE",path:"/1{path}".replace("{path}",e),queryParameters:t||{},headers:{}};return n.request(s,r)},get({path:e,parameters:t},r){if(!e)throw new Error("Parameter `path` is required when calling `get`.");const s={method:"GET",path:"/1{path}".replace("{path}",e),queryParameters:t||{},headers:{}};return n.request(s,r)},getRecommendations(e,t){if(!e)throw new Error("Parameter `getRecommendationsParams` is required when calling `getRecommendations`.");if(!e.requests)throw new Error("Parameter `getRecommendationsParams.requests` is required when calling `getRecommendations`.");const r={method:"POST",path:"/1/indexes/*/recommendations",queryParameters:{},headers:{},data:e,useReadTransporter:!0,cacheable:!0};return n.request(r,t)},post({path:e,parameters:t,body:r},s){if(!e)throw new Error("Parameter `path` is required when calling `post`.");const a={method:"POST",path:"/1{path}".replace("{path}",e),queryParameters:t||{},headers:{},data:r||{}};return n.request(a,s)},put({path:e,parameters:t,body:r},s){if(!e)throw new Error("Parameter `path` is required when calling `put`.");const a={method:"PUT",path:"/1{path}".replace("{path}",e),queryParameters:t||{},headers:{},data:r||{}};return n.request(a,s)}}}({appId:e,apiKey:a,timeouts:{connect:1e3,read:2e3,write:3e4},requester:{send:function(e){return new Promise((t=>{const r=new XMLHttpRequest;r.open(e.method,e.url,!0),Object.keys(e.headers).forEach((t=>r.setRequestHeader(t,e.headers[t])));const s=(e,s)=>setTimeout((()=>{r.abort(),t({status:0,content:s,isTimedOut:!0})}),e),a=s(e.connectTimeout,"Connection timeout");let o;r.onreadystatechange=()=>{r.readyState>r.OPENED&&void 0===o&&(clearTimeout(a),o=s(e.responseTimeout,"Socket timeout"))},r.onerror=()=>{0===r.status&&(clearTimeout(a),clearTimeout(o),t({content:r.responseText||"Network request failed",status:r.status,isTimedOut:!1}))},r.onload=()=>{clearTimeout(a),clearTimeout(o),t({content:r.responseText,status:r.status,isTimedOut:!1})},r.send(e.data)}))}},algoliaAgents:[{segment:"Browser"}],authMode:"WithinQueryParameters",responsesCache:s(),requestsCache:s({serializable:!1}),hostsCache:r({caches:[t({key:`5.0.0-alpha.11-${e}`}),s()]}),...o})}}));
1
+ /*! recommend.umd.js | 5.0.0-alpha.110 | © Algolia, inc. | https://github.com/algolia/algoliasearch-client-javascript */
2
+ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self)["@algolia/recommend"]={})}(this,(function(e){"use strict";function t(e){let t;const r=`algolia-client-js-${e.key}`;function a(){return void 0===t&&(t=e.localStorage||window.localStorage),t}function o(){return JSON.parse(a().getItem(r)||"{}")}function s(e){a().setItem(r,JSON.stringify(e))}return{get:(t,r,a={miss:()=>Promise.resolve()})=>Promise.resolve().then((()=>(function(){const t=e.timeToLive?1e3*e.timeToLive:null,r=o(),a=Object.fromEntries(Object.entries(r).filter((([,e])=>void 0!==e.timestamp)));if(s(a),!t)return;s(Object.fromEntries(Object.entries(a).filter((([,e])=>{const r=(new Date).getTime();return!(e.timestamp+t<r)}))))}(),o()[JSON.stringify(t)]))).then((e=>Promise.all([e?e.value:r(),void 0!==e]))).then((([e,t])=>Promise.all([e,t||a.miss(e)]))).then((([e])=>e)),set:(e,t)=>Promise.resolve().then((()=>{const s=o();return s[JSON.stringify(e)]={timestamp:(new Date).getTime(),value:t},a().setItem(r,JSON.stringify(s)),t})),delete:e=>Promise.resolve().then((()=>{const t=o();delete t[JSON.stringify(e)],a().setItem(r,JSON.stringify(t))})),clear:()=>Promise.resolve().then((()=>{a().removeItem(r)}))}}function r(e){const t=[...e.caches],a=t.shift();return void 0===a?{get:(e,t,r={miss:()=>Promise.resolve()})=>t().then((e=>Promise.all([e,r.miss(e)]))).then((([e])=>e)),set:(e,t)=>Promise.resolve(t),delete:e=>Promise.resolve(),clear:()=>Promise.resolve()}:{get:(e,o,s={miss:()=>Promise.resolve()})=>a.get(e,o,s).catch((()=>r({caches:t}).get(e,o,s))),set:(e,o)=>a.set(e,o).catch((()=>r({caches:t}).set(e,o))),delete:e=>a.delete(e).catch((()=>r({caches:t}).delete(e))),clear:()=>a.clear().catch((()=>r({caches:t}).clear()))}}function a(e={serializable:!0}){let t={};return{get(r,a,o={miss:()=>Promise.resolve()}){const s=JSON.stringify(r);if(s in t)return Promise.resolve(e.serializable?JSON.parse(t[s]):t[s]);const n=a();return n.then((e=>o.miss(e))).then((()=>n))},set:(r,a)=>(t[JSON.stringify(r)]=e.serializable?JSON.stringify(a):a,Promise.resolve(a)),delete:e=>(delete t[JSON.stringify(e)],Promise.resolve()),clear:()=>(t={},Promise.resolve())}}const o=12e4;function s(e,t="up"){const r=Date.now();return{...e,status:t,lastUpdate:r,isUp:function(){return"up"===t||Date.now()-r>o},isTimedOut:function(){return"timed out"===t&&Date.now()-r<=o}}}function n(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var a=r.call(e,t||"default");if("object"!=typeof a)return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}function i(e,t,r){return(t=n(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class c extends Error{constructor(e,t){super(e),i(this,"name","AlgoliaError"),t&&(this.name=t)}}class l extends c{constructor(e,t,r){super(e,r),i(this,"stackTrace",void 0),this.stackTrace=t}}class u extends l{constructor(e){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.",e,"RetryError")}}class m extends l{constructor(e,t,r,a="ApiError"){super(e,r,a),i(this,"status",void 0),this.status=t}}class d extends c{constructor(e,t){super(e,"DeserializationError"),i(this,"response",void 0),this.response=t}}class h extends m{constructor(e,t,r,a){super(e,t,a,"DetailedApiError"),i(this,"error",void 0),this.error=r}}function p(e,t,r){const a=function(e){const t=e=>"[object Object]"===Object.prototype.toString.call(e)||"[object Array]"===Object.prototype.toString.call(e);return Object.keys(e).map((r=>`${r}=${encodeURIComponent(t(e[r])?JSON.stringify(e[r]):e[r]).replaceAll("+","%20")}`)).join("&")}(r);let o=`${e.protocol}://${e.url}${e.port?`:${e.port}`:""}/${"/"===t.charAt(0)?t.substring(1):t}`;return a.length&&(o+=`?${a}`),o}function g(e){const t=e.request.headers["x-algolia-api-key"]?{"x-algolia-api-key":"*****"}:{};return{...e,request:{...e.request,headers:{...e.request.headers,...t}}}}function f({hosts:e,hostsCache:t,baseHeaders:r,baseQueryParameters:a,algoliaAgent:o,timeouts:n,requester:i,requestsCache:c,responsesCache:l}){async function f(c,l,f=!0){const w=[],y=function(e,t){if("GET"===e.method||void 0===e.data&&void 0===t.data)return;const r=Array.isArray(e.data)?e.data:{...e.data,...t.data};return JSON.stringify(r)}(c,l),P=function(e,t,r){const a={Accept:"application/json",...e,...t,...r},o={};return Object.keys(a).forEach((e=>{const t=a[e];o[e.toLowerCase()]=t})),o}(r,c.headers,l.headers),q="GET"===c.method?{...c.data,...l.data}:{},b={...a,...c.queryParameters,...q};if(o.value&&(b["x-algolia-agent"]=o.value),l&&l.queryParameters)for(const e of Object.keys(l.queryParameters))l.queryParameters[e]&&"[object Object]"!==Object.prototype.toString.call(l.queryParameters[e])?b[e]=l.queryParameters[e].toString():b[e]=l.queryParameters[e];let v=0;const R=async(e,r)=>{const a=e.pop();if(void 0===a)throw new u(function(e){return e.map((e=>g(e)))}(w));let o=l.timeout;void 0===o&&(o=f?n.read:n.write);const q={data:y,headers:P,method:c.method,url:p(a,c.path,b),connectTimeout:r(v,n.connect),responseTimeout:r(v,o)},T=t=>{const r={request:q,response:t,host:a,triesLeft:e.length};return w.push(r),r},O=await i.send(q);if(function({isTimedOut:e,status:t}){return e||function({isTimedOut:e,status:t}){return!e&&!~~t}({isTimedOut:e,status:t})||2!=~~(t/100)&&4!=~~(t/100)}(O)){const o=T(O);return O.isTimedOut&&v++,console.log("Retryable failure",g(o)),await t.set(a,s(a,O.isTimedOut?"timed out":"down")),R(e,r)}if(function({status:e}){return 2==~~(e/100)}(O))return function(e){try{return JSON.parse(e.content)}catch(t){throw new d(t.message,e)}}(O);throw T(O),function({content:e,status:t},r){try{const a=JSON.parse(e);return"error"in a?new h(a.message,t,a.error,r):new m(a.message,t,r)}catch(e){}return new m(e,t,r)}(O,w)},T=e.filter((e=>"readWrite"===e.accept||(f?"read"===e.accept:"write"===e.accept))),O=await async function(e){const r=await Promise.all(e.map((e=>t.get(e,(()=>Promise.resolve(s(e))))))),a=r.filter((e=>e.isUp())),o=r.filter((e=>e.isTimedOut())),n=[...a,...o];return{hosts:n.length>0?n:e,getTimeout:(e,t)=>(0===o.length&&0===e?1:o.length+3+e)*t}}(T);return R([...O.hosts].reverse(),O.getTimeout)}return{hostsCache:t,requester:i,timeouts:n,algoliaAgent:o,baseHeaders:r,baseQueryParameters:a,hosts:e,request:function(e,t={}){const o=e.useReadTransporter||"GET"===e.method;if(!o)return f(e,t,o);const s=()=>f(e,t);if(!0!==(t.cacheable||e.cacheable))return s();const n={request:e,requestOptions:t,transporter:{queryParameters:a,headers:r}};return l.get(n,(()=>c.get(n,(()=>c.set(n,s()).then((e=>Promise.all([c.delete(n),e])),(e=>Promise.all([c.delete(n),Promise.reject(e)]))).then((([e,t])=>t))))),{miss:e=>l.set(n,e)})},requestsCache:c,responsesCache:l}}function w({algoliaAgents:e,client:t,version:r}){const a=function(e){const t={value:`Algolia for JavaScript (${e})`,add(e){const r=`; ${e.segment}${void 0!==e.version?` (${e.version})`:""}`;return-1===t.value.indexOf(r)&&(t.value=`${t.value}${r}`),t}};return t}(r).add({segment:t,version:r});return e.forEach((e=>a.add(e))),a}const y="5.0.0-alpha.110";function P(e){return[{url:`${e}-dsn.algolia.net`,accept:"read",protocol:"https"},{url:`${e}.algolia.net`,accept:"write",protocol:"https"}].concat(function(e){const t=e;for(let r=e.length-1;r>0;r--){const a=Math.floor(Math.random()*(r+1)),o=e[r];t[r]=e[a],t[a]=o}return t}([{url:`${e}-1.algolianet.com`,accept:"readWrite",protocol:"https"},{url:`${e}-2.algolianet.com`,accept:"readWrite",protocol:"https"},{url:`${e}-3.algolianet.com`,accept:"readWrite",protocol:"https"}]))}e.apiClientVersion=y,e.recommendClient=function(e,o,s){if(!e||"string"!=typeof e)throw new Error("`appId` is missing.");if(!o||"string"!=typeof o)throw new Error("`apiKey` is missing.");return function({appId:e,apiKey:t,authMode:r,algoliaAgents:a,...o}){const s=function(e,t,r="WithinHeaders"){const a={"x-algolia-api-key":t,"x-algolia-application-id":e};return{headers:()=>"WithinHeaders"===r?a:{},queryParameters:()=>"WithinQueryParameters"===r?a:{}}}(e,t,r),n=f({hosts:P(e),...o,algoliaAgent:w({algoliaAgents:a,client:"Recommend",version:y}),baseHeaders:{"content-type":"text/plain",...s.headers(),...o.baseHeaders},baseQueryParameters:{...s.queryParameters(),...o.baseQueryParameters}});return{transporter:n,appId:e,clearCache:()=>Promise.all([n.requestsCache.clear(),n.responsesCache.clear()]).then((()=>{})),get _ua(){return n.algoliaAgent.value},addAlgoliaAgent(e,t){n.algoliaAgent.add({segment:e,version:t})},customDelete({path:e,parameters:t},r){if(!e)throw new Error("Parameter `path` is required when calling `customDelete`.");const a={method:"DELETE",path:"/{path}".replace("{path}",e),queryParameters:t||{},headers:{}};return n.request(a,r)},customGet({path:e,parameters:t},r){if(!e)throw new Error("Parameter `path` is required when calling `customGet`.");const a={method:"GET",path:"/{path}".replace("{path}",e),queryParameters:t||{},headers:{}};return n.request(a,r)},customPost({path:e,parameters:t,body:r},a){if(!e)throw new Error("Parameter `path` is required when calling `customPost`.");const o={method:"POST",path:"/{path}".replace("{path}",e),queryParameters:t||{},headers:{},data:r||{}};return n.request(o,a)},customPut({path:e,parameters:t,body:r},a){if(!e)throw new Error("Parameter `path` is required when calling `customPut`.");const o={method:"PUT",path:"/{path}".replace("{path}",e),queryParameters:t||{},headers:{},data:r||{}};return n.request(o,a)},deleteRecommendRule({indexName:e,model:t,objectID:r},a){if(!e)throw new Error("Parameter `indexName` is required when calling `deleteRecommendRule`.");if(!t)throw new Error("Parameter `model` is required when calling `deleteRecommendRule`.");if(!r)throw new Error("Parameter `objectID` is required when calling `deleteRecommendRule`.");const o={method:"DELETE",path:"/1/indexes/{indexName}/{model}/recommend/rules/{objectID}".replace("{indexName}",encodeURIComponent(e)).replace("{model}",encodeURIComponent(t)).replace("{objectID}",encodeURIComponent(r)),queryParameters:{},headers:{}};return n.request(o,a)},getRecommendRule({indexName:e,model:t,objectID:r},a){if(!e)throw new Error("Parameter `indexName` is required when calling `getRecommendRule`.");if(!t)throw new Error("Parameter `model` is required when calling `getRecommendRule`.");if(!r)throw new Error("Parameter `objectID` is required when calling `getRecommendRule`.");const o={method:"GET",path:"/1/indexes/{indexName}/{model}/recommend/rules/{objectID}".replace("{indexName}",encodeURIComponent(e)).replace("{model}",encodeURIComponent(t)).replace("{objectID}",encodeURIComponent(r)),queryParameters:{},headers:{}};return n.request(o,a)},getRecommendStatus({indexName:e,model:t,taskID:r},a){if(!e)throw new Error("Parameter `indexName` is required when calling `getRecommendStatus`.");if(!t)throw new Error("Parameter `model` is required when calling `getRecommendStatus`.");if(!r)throw new Error("Parameter `taskID` is required when calling `getRecommendStatus`.");const o={method:"GET",path:"/1/indexes/{indexName}/{model}/task/{taskID}".replace("{indexName}",encodeURIComponent(e)).replace("{model}",encodeURIComponent(t)).replace("{taskID}",encodeURIComponent(r)),queryParameters:{},headers:{}};return n.request(o,a)},getRecommendations(e,t){if(!e)throw new Error("Parameter `getRecommendationsParams` is required when calling `getRecommendations`.");if(!e.requests)throw new Error("Parameter `getRecommendationsParams.requests` is required when calling `getRecommendations`.");const r={method:"POST",path:"/1/indexes/*/recommendations",queryParameters:{},headers:{},data:e,useReadTransporter:!0,cacheable:!0};return n.request(r,t)},searchRecommendRules({indexName:e,model:t,searchRecommendRulesParams:r},a){if(!e)throw new Error("Parameter `indexName` is required when calling `searchRecommendRules`.");if(!t)throw new Error("Parameter `model` is required when calling `searchRecommendRules`.");const o={method:"POST",path:"/1/indexes/{indexName}/{model}/recommend/rules/search".replace("{indexName}",encodeURIComponent(e)).replace("{model}",encodeURIComponent(t)),queryParameters:{},headers:{},data:r||{},useReadTransporter:!0,cacheable:!0};return n.request(o,a)}}}({appId:e,apiKey:o,timeouts:{connect:1e3,read:2e3,write:3e4},requester:{send:function(e){return new Promise((t=>{const r=new XMLHttpRequest;r.open(e.method,e.url,!0),Object.keys(e.headers).forEach((t=>r.setRequestHeader(t,e.headers[t])));const a=(e,a)=>setTimeout((()=>{r.abort(),t({status:0,content:a,isTimedOut:!0})}),e),o=a(e.connectTimeout,"Connection timeout");let s;r.onreadystatechange=()=>{r.readyState>r.OPENED&&void 0===s&&(clearTimeout(o),s=a(e.responseTimeout,"Socket timeout"))},r.onerror=()=>{0===r.status&&(clearTimeout(o),clearTimeout(s),t({content:r.responseText||"Network request failed",status:r.status,isTimedOut:!1}))},r.onload=()=>{clearTimeout(o),clearTimeout(s),t({content:r.responseText,status:r.status,isTimedOut:!1})},r.send(e.data)}))}},algoliaAgents:[{segment:"Browser"}],authMode:"WithinQueryParameters",responsesCache:a(),requestsCache:a({serializable:!1}),hostsCache:r({caches:[t({key:`${y}-${e}`}),a()]}),...s})}}));
@@ -1,82 +1,132 @@
1
- import type { CreateClientOptions, RequestOptions } from '@algolia/client-common';
2
- import type { DelProps, GetProps, PostProps, PutProps } from '../model/clientMethodProps';
3
- import type { GetRecommendationsParams } from '../model/getRecommendationsParams';
4
- import type { GetRecommendationsResponse } from '../model/getRecommendationsResponse';
5
- export declare const apiClientVersion = "5.0.0-alpha.11";
6
- export declare function createRecommendClient({ appId: appIdOption, apiKey: apiKeyOption, authMode, algoliaAgents, ...options }: CreateClientOptions): {
7
- transporter: import("@algolia/client-common").Transporter;
8
- /**
9
- * The `appId` currently in use.
10
- */
11
- appId: string;
12
- /**
13
- * Clears the cache of the transporter for the `requestsCache` and `responsesCache` properties.
14
- */
15
- clearCache(): Promise<void>;
16
- /**
17
- * Get the value of the `algoliaAgent`, used by our libraries internally and telemetry system.
18
- */
19
- readonly _ua: string;
20
- /**
21
- * Adds a `segment` to the `x-algolia-agent` sent with every requests.
22
- *
23
- * @param segment - The algolia agent (user-agent) segment to add.
24
- * @param version - The version of the agent.
25
- */
26
- addAlgoliaAgent(segment: string, version?: string): void;
27
- /**
28
- * This method allow you to send requests to the Algolia REST API.
29
- *
30
- * @summary Send requests to the Algolia REST API.
31
- * @param del - The del object.
32
- * @param del.path - The path of the API endpoint to target, anything after the /1 needs to be specified.
33
- * @param del.parameters - Query parameters to be applied to the current query.
34
- * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
35
- */
36
- del({ path, parameters }: DelProps, requestOptions?: RequestOptions): Promise<Record<string, any>>;
37
- /**
38
- * This method allow you to send requests to the Algolia REST API.
39
- *
40
- * @summary Send requests to the Algolia REST API.
41
- * @param get - The get object.
42
- * @param get.path - The path of the API endpoint to target, anything after the /1 needs to be specified.
43
- * @param get.parameters - Query parameters to be applied to the current query.
44
- * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
45
- */
46
- get({ path, parameters }: GetProps, requestOptions?: RequestOptions): Promise<Record<string, any>>;
47
- /**
48
- * Returns recommendations or trending results, for a specific model and `objectID`.
49
- *
50
- * @summary Get results.
51
- * @param getRecommendationsParams - The getRecommendationsParams object.
52
- * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
53
- */
54
- getRecommendations(getRecommendationsParams: GetRecommendationsParams, requestOptions?: RequestOptions): Promise<GetRecommendationsResponse>;
55
- /**
56
- * This method allow you to send requests to the Algolia REST API.
57
- *
58
- * @summary Send requests to the Algolia REST API.
59
- * @param post - The post object.
60
- * @param post.path - The path of the API endpoint to target, anything after the /1 needs to be specified.
61
- * @param post.parameters - Query parameters to be applied to the current query.
62
- * @param post.body - The parameters to send with the custom request.
63
- * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
64
- */
65
- post({ path, parameters, body }: PostProps, requestOptions?: RequestOptions): Promise<Record<string, any>>;
66
- /**
67
- * This method allow you to send requests to the Algolia REST API.
68
- *
69
- * @summary Send requests to the Algolia REST API.
70
- * @param put - The put object.
71
- * @param put.path - The path of the API endpoint to target, anything after the /1 needs to be specified.
72
- * @param put.parameters - Query parameters to be applied to the current query.
73
- * @param put.body - The parameters to send with the custom request.
74
- * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
75
- */
76
- put({ path, parameters, body }: PutProps, requestOptions?: RequestOptions): Promise<Record<string, any>>;
77
- };
78
- /**
79
- * The client type.
80
- */
81
- export declare type RecommendClient = ReturnType<typeof createRecommendClient>;
1
+ import type { CreateClientOptions, RequestOptions } from '@algolia/client-common';
2
+ import type { CustomDeleteProps, CustomGetProps, CustomPostProps, CustomPutProps, DeleteRecommendRuleProps, GetRecommendRuleProps, GetRecommendStatusProps, SearchRecommendRulesProps } from '../model/clientMethodProps';
3
+ import type { DeletedAtResponse } from '../model/deletedAtResponse';
4
+ import type { GetRecommendTaskResponse } from '../model/getRecommendTaskResponse';
5
+ import type { GetRecommendationsParams } from '../model/getRecommendationsParams';
6
+ import type { GetRecommendationsResponse } from '../model/getRecommendationsResponse';
7
+ import type { RuleResponse } from '../model/ruleResponse';
8
+ import type { SearchRecommendRulesResponse } from '../model/searchRecommendRulesResponse';
9
+ export declare const apiClientVersion = "5.0.0-alpha.110";
10
+ export declare function createRecommendClient({ appId: appIdOption, apiKey: apiKeyOption, authMode, algoliaAgents, ...options }: CreateClientOptions): {
11
+ transporter: import("@algolia/client-common").Transporter;
12
+ /**
13
+ * The `appId` currently in use.
14
+ */
15
+ appId: string;
16
+ /**
17
+ * Clears the cache of the transporter for the `requestsCache` and `responsesCache` properties.
18
+ */
19
+ clearCache(): Promise<void>;
20
+ /**
21
+ * Get the value of the `algoliaAgent`, used by our libraries internally and telemetry system.
22
+ */
23
+ readonly _ua: string;
24
+ /**
25
+ * Adds a `segment` to the `x-algolia-agent` sent with every requests.
26
+ *
27
+ * @param segment - The algolia agent (user-agent) segment to add.
28
+ * @param version - The version of the agent.
29
+ */
30
+ addAlgoliaAgent(segment: string, version?: string): void;
31
+ /**
32
+ * This method allow you to send requests to the Algolia REST API.
33
+ *
34
+ * @param customDelete - The customDelete object.
35
+ * @param customDelete.path - Path of the endpoint, anything after \"/1\" must be specified.
36
+ * @param customDelete.parameters - Query parameters to apply to the current query.
37
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
38
+ */
39
+ customDelete({ path, parameters }: CustomDeleteProps, requestOptions?: RequestOptions): Promise<Record<string, any>>;
40
+ /**
41
+ * This method allow you to send requests to the Algolia REST API.
42
+ *
43
+ * @param customGet - The customGet object.
44
+ * @param customGet.path - Path of the endpoint, anything after \"/1\" must be specified.
45
+ * @param customGet.parameters - Query parameters to apply to the current query.
46
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
47
+ */
48
+ customGet({ path, parameters }: CustomGetProps, requestOptions?: RequestOptions): Promise<Record<string, any>>;
49
+ /**
50
+ * This method allow you to send requests to the Algolia REST API.
51
+ *
52
+ * @param customPost - The customPost object.
53
+ * @param customPost.path - Path of the endpoint, anything after \"/1\" must be specified.
54
+ * @param customPost.parameters - Query parameters to apply to the current query.
55
+ * @param customPost.body - Parameters to send with the custom request.
56
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
57
+ */
58
+ customPost({ path, parameters, body }: CustomPostProps, requestOptions?: RequestOptions): Promise<Record<string, any>>;
59
+ /**
60
+ * This method allow you to send requests to the Algolia REST API.
61
+ *
62
+ * @param customPut - The customPut object.
63
+ * @param customPut.path - Path of the endpoint, anything after \"/1\" must be specified.
64
+ * @param customPut.parameters - Query parameters to apply to the current query.
65
+ * @param customPut.body - Parameters to send with the custom request.
66
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
67
+ */
68
+ customPut({ path, parameters, body }: CustomPutProps, requestOptions?: RequestOptions): Promise<Record<string, any>>;
69
+ /**
70
+ * Delete a [Recommend rule](https://www.algolia.com/doc/guides/algolia-recommend/how-to/rules/).
71
+ *
72
+ * Required API Key ACLs:
73
+ * - editSettings.
74
+ *
75
+ * @param deleteRecommendRule - The deleteRecommendRule object.
76
+ * @param deleteRecommendRule.indexName - Name of the index on which to perform the operation.
77
+ * @param deleteRecommendRule.model - [Recommend models](https://www.algolia.com/doc/guides/algolia-recommend/overview/#recommend-models).
78
+ * @param deleteRecommendRule.objectID - Unique record identifier.
79
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
80
+ */
81
+ deleteRecommendRule({ indexName, model, objectID }: DeleteRecommendRuleProps, requestOptions?: RequestOptions): Promise<DeletedAtResponse>;
82
+ /**
83
+ * Return a [Recommend rule](https://www.algolia.com/doc/guides/algolia-recommend/how-to/rules/).
84
+ *
85
+ * Required API Key ACLs:
86
+ * - settings.
87
+ *
88
+ * @param getRecommendRule - The getRecommendRule object.
89
+ * @param getRecommendRule.indexName - Name of the index on which to perform the operation.
90
+ * @param getRecommendRule.model - [Recommend models](https://www.algolia.com/doc/guides/algolia-recommend/overview/#recommend-models).
91
+ * @param getRecommendRule.objectID - Unique record identifier.
92
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
93
+ */
94
+ getRecommendRule({ indexName, model, objectID }: GetRecommendRuleProps, requestOptions?: RequestOptions): Promise<RuleResponse>;
95
+ /**
96
+ * Some operations, such as deleting a Recommend rule, will respond with a `taskID` value. Use this value here to check the status of that task.
97
+ *
98
+ * Required API Key ACLs:
99
+ * - editSettings.
100
+ *
101
+ * @param getRecommendStatus - The getRecommendStatus object.
102
+ * @param getRecommendStatus.indexName - Name of the index on which to perform the operation.
103
+ * @param getRecommendStatus.model - [Recommend models](https://www.algolia.com/doc/guides/algolia-recommend/overview/#recommend-models).
104
+ * @param getRecommendStatus.taskID - Unique identifier of a task. Numeric value (up to 64bits).
105
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
106
+ */
107
+ getRecommendStatus({ indexName, model, taskID }: GetRecommendStatusProps, requestOptions?: RequestOptions): Promise<GetRecommendTaskResponse>;
108
+ /**
109
+ * Returns results from either recommendation or trending models: - **Recommendations** are provided by the [Related Products](https://www.algolia.com/doc/guides/algolia-recommend/overview/#related-products-and-related-content) and [Frequently Bought Together](https://www.algolia.com/doc/guides/algolia-recommend/overview/#frequently-bought-together) models - **Trending** models are [Trending Items and Trending Facet Values](https://www.algolia.com/doc/guides/algolia-recommend/overview/#trending-items-and-trending-facet-values).
110
+ *
111
+ * Required API Key ACLs:
112
+ * - search.
113
+ *
114
+ * @param getRecommendationsParams - The getRecommendationsParams object.
115
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
116
+ */
117
+ getRecommendations(getRecommendationsParams: GetRecommendationsParams, requestOptions?: RequestOptions): Promise<GetRecommendationsResponse>;
118
+ /**
119
+ * List [Recommend rules](https://www.algolia.com/doc/guides/algolia-recommend/how-to/rules/).
120
+ *
121
+ * Required API Key ACLs:
122
+ * - settings.
123
+ *
124
+ * @param searchRecommendRules - The searchRecommendRules object.
125
+ * @param searchRecommendRules.indexName - Name of the index on which to perform the operation.
126
+ * @param searchRecommendRules.model - [Recommend models](https://www.algolia.com/doc/guides/algolia-recommend/overview/#recommend-models).
127
+ * @param searchRecommendRules.searchRecommendRulesParams - The searchRecommendRulesParams object.
128
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
129
+ */
130
+ searchRecommendRules({ indexName, model, searchRecommendRulesParams, }: SearchRecommendRulesProps, requestOptions?: RequestOptions): Promise<SearchRecommendRulesResponse>;
131
+ };
82
132
  //# sourceMappingURL=recommendClient.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"recommendClient.d.ts","sourceRoot":"","sources":["../../src/recommendClient.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EACV,mBAAmB,EAInB,cAAc,EAEf,MAAM,wBAAwB,CAAC;AAEhC,OAAO,KAAK,EACV,QAAQ,EACR,QAAQ,EACR,SAAS,EACT,QAAQ,EACT,MAAM,4BAA4B,CAAC;AACpC,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,mCAAmC,CAAC;AAClF,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,qCAAqC,CAAC;AAEtF,eAAO,MAAM,gBAAgB,mBAAmB,CAAC;AAsCjD,wBAAgB,qBAAqB,CAAC,EACpC,KAAK,EAAE,WAAW,EAClB,MAAM,EAAE,YAAY,EACpB,QAAQ,EACR,aAAa,EACb,GAAG,OAAO,EACX,EAAE,mBAAmB;;IAwBlB;;OAEG;;IAGH;;OAEG;kBACW,QAAQ,IAAI,CAAC;IAO3B;;OAEG;;IAKH;;;;;OAKG;6BACsB,MAAM,YAAY,MAAM,GAAG,IAAI;IAIxD;;;;;;;;OAQG;8BAEqB,QAAQ,mBACb,cAAc,GAC9B,QAAQ,OAAO,MAAM,EAAE,GAAG,CAAC,CAAC;IAmB/B;;;;;;;;OAQG;8BAEqB,QAAQ,mBACb,cAAc,GAC9B,QAAQ,OAAO,MAAM,EAAE,GAAG,CAAC,CAAC;IAmB/B;;;;;;OAMG;iDAEyB,wBAAwB,mBACjC,cAAc,GAC9B,QAAQ,0BAA0B,CAAC;IA8BtC;;;;;;;;;OASG;qCAE2B,SAAS,mBACpB,cAAc,GAC9B,QAAQ,OAAO,MAAM,EAAE,GAAG,CAAC,CAAC;IAoB/B;;;;;;;;;OASG;oCAE2B,QAAQ,mBACnB,cAAc,GAC9B,QAAQ,OAAO,MAAM,EAAE,GAAG,CAAC,CAAC;EAoBlC;AAED;;GAEG;AACH,oBAAY,eAAe,GAAG,UAAU,CAAC,OAAO,qBAAqB,CAAC,CAAC"}
1
+ {"version":3,"file":"recommendClient.d.ts","sourceRoot":"","sources":["../../src/recommendClient.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EACV,mBAAmB,EAKnB,cAAc,EACf,MAAM,wBAAwB,CAAC;AAEhC,OAAO,KAAK,EACV,iBAAiB,EACjB,cAAc,EACd,eAAe,EACf,cAAc,EACd,wBAAwB,EACxB,qBAAqB,EACrB,uBAAuB,EACvB,yBAAyB,EAC1B,MAAM,4BAA4B,CAAC;AACpC,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AACpE,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,mCAAmC,CAAC;AAClF,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,mCAAmC,CAAC;AAClF,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,qCAAqC,CAAC;AACtF,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAC1D,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,uCAAuC,CAAC;AAE1F,eAAO,MAAM,gBAAgB,oBAAoB,CAAC;AAsClD,wBAAgB,qBAAqB,CAAC,EACpC,KAAK,EAAE,WAAW,EAClB,MAAM,EAAE,YAAY,EACpB,QAAQ,EACR,aAAa,EACb,GAAG,OAAO,EACX,EAAE,mBAAmB;;IAwBlB;;OAEG;;IAGH;;OAEG;kBACW,QAAQ,IAAI,CAAC;IAO3B;;OAEG;;IAKH;;;;;OAKG;6BACsB,MAAM,YAAY,MAAM,GAAG,IAAI;IAIxD;;;;;;;OAOG;uCAEqB,iBAAiB,mBACtB,cAAc,GAC9B,QAAQ,OAAO,MAAM,EAAE,GAAG,CAAC,CAAC;IAqB/B;;;;;;;OAOG;oCAEqB,cAAc,mBACnB,cAAc,GAC9B,QAAQ,OAAO,MAAM,EAAE,GAAG,CAAC,CAAC;IAqB/B;;;;;;;;OAQG;2CAE2B,eAAe,mBAC1B,cAAc,GAC9B,QAAQ,OAAO,MAAM,EAAE,GAAG,CAAC,CAAC;IAsB/B;;;;;;;;OAQG;0CAE2B,cAAc,mBACzB,cAAc,GAC9B,QAAQ,OAAO,MAAM,EAAE,GAAG,CAAC,CAAC;IAsB/B;;;;;;;;;;;OAWG;wDAE+B,wBAAwB,mBACvC,cAAc,GAC9B,QAAQ,iBAAiB,CAAC;IAqC7B;;;;;;;;;;;OAWG;qDAE+B,qBAAqB,mBACpC,cAAc,GAC9B,QAAQ,YAAY,CAAC;IAqCxB;;;;;;;;;;;OAWG;qDAE6B,uBAAuB,mBACpC,cAAc,GAC9B,QAAQ,wBAAwB,CAAC;IAoCpC;;;;;;;;OAQG;iDAEyB,wBAAwB,mBACjC,cAAc,GAC9B,QAAQ,0BAA0B,CAAC;IA8BtC;;;;;;;;;;;OAWG;4EAME,yBAAyB,mBACX,cAAc,GAC9B,QAAQ,4BAA4B,CAAC;EAiC3C"}
package/index.js CHANGED
@@ -1,2 +1,2 @@
1
1
  // eslint-disable-next-line import/no-commonjs,import/extensions
2
- module.exports = require('./dist/recommend.cjs.js');
2
+ module.exports = require('./dist/recommend.cjs');
@@ -1,3 +1,3 @@
1
- // This file is generated, manual changes will be lost - read more on https://github.com/algolia/api-clients-automation.
1
+ // 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.
2
2
 
3
3
  export type AdvancedSyntaxFeatures = 'exactPhrase' | 'excludeWords';
@@ -1,4 +1,4 @@
1
- // This file is generated, manual changes will be lost - read more on https://github.com/algolia/api-clients-automation.
1
+ // 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.
2
2
 
3
3
  export type AlternativesAsExact =
4
4
  | 'ignorePlurals'
@@ -0,0 +1,6 @@
1
+ // 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.
2
+
3
+ /**
4
+ * Which part of the search query the pattern should match: - `startsWith`. The pattern must match the begginning of the query. - `endsWith`. The pattern must match the end of the query. - `is`. The pattern must match the query exactly. - `contains`. The pattern must match anywhere in the query. Empty queries are only allowed as pattern with `anchoring: is`.
5
+ */
6
+ export type Anchoring = 'contains' | 'endsWith' | 'is' | 'startsWith';
@@ -0,0 +1,8 @@
1
+ // 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.
2
+
3
+ import type { AroundPrecisionFromValueInner } from './aroundPrecisionFromValueInner';
4
+
5
+ /**
6
+ * Precision of a coordinate-based search in meters to group results with similar distances. The Geo ranking criterion considers all matches within the same range of distances to be equal.
7
+ */
8
+ export type AroundPrecision = AroundPrecisionFromValueInner[] | number;
@@ -0,0 +1,16 @@
1
+ // 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.
2
+
3
+ /**
4
+ * Range object with lower and upper values in meters to define custom ranges.
5
+ */
6
+ export type AroundPrecisionFromValueInner = {
7
+ /**
8
+ * Lower boundary of a range in meters. The Geo ranking criterion considers all records within the range to be equal.
9
+ */
10
+ from?: number;
11
+
12
+ /**
13
+ * Upper boundary of a range in meters. The Geo ranking criterion considers all records within the range to be equal.
14
+ */
15
+ value?: number;
16
+ };
@@ -1,8 +1,8 @@
1
- // This file is generated, manual changes will be lost - read more on https://github.com/algolia/api-clients-automation.
1
+ // 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.
2
2
 
3
3
  import type { AroundRadiusAll } from './aroundRadiusAll';
4
4
 
5
5
  /**
6
- * Define the maximum radius for a geo search (in meters).
6
+ * Maximum radius for a search around a central location. This parameter works in combination with the `aroundLatLng` and `aroundLatLngViaIP` parameters. By default, the search radius is determined automatically from the density of hits around the central location. The search radius is small if there are many hits close to the central coordinates.
7
7
  */
8
8
  export type AroundRadius = AroundRadiusAll | number;
@@ -1,3 +1,6 @@
1
- // This file is generated, manual changes will be lost - read more on https://github.com/algolia/api-clients-automation.
1
+ // 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.
2
2
 
3
+ /**
4
+ * Return all records with a valid `_geoloc` attribute. Don\'t filter by distance.
5
+ */
3
6
  export type AroundRadiusAll = 'all';
@@ -0,0 +1,21 @@
1
+ // 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.
2
+
3
+ /**
4
+ * Filter or optional filter to be applied to the search.
5
+ */
6
+ export type AutomaticFacetFilter = {
7
+ /**
8
+ * Facet name to be applied as filter. The name must match placeholders in the `pattern` parameter. For example, with `pattern: {facet:genre}`, `automaticFacetFilters` must be `genre`.
9
+ */
10
+ facet: string;
11
+
12
+ /**
13
+ * Filter scores to give different weights to individual filters.
14
+ */
15
+ score?: number;
16
+
17
+ /**
18
+ * Whether the filter is disjunctive or conjunctive. If true the filter has multiple matches, multiple occurences are combined with the logical `OR` operation. If false, multiple occurences are combined with the logical `AND` operation.
19
+ */
20
+ disjunctive?: boolean;
21
+ };
@@ -0,0 +1,8 @@
1
+ // 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.
2
+
3
+ import type { AutomaticFacetFilter } from './automaticFacetFilter';
4
+
5
+ /**
6
+ * Filter to be applied to the search. You can use this to respond to search queries that match a facet value. For example, if users search for \"comedy\", which matches a facet value of the \"genre\" facet, you can filter the results to show the top-ranked comedy movies.
7
+ */
8
+ export type AutomaticFacetFilters = AutomaticFacetFilter[] | string[];
@@ -1,24 +1,18 @@
1
- // This file is generated, manual changes will be lost - read more on https://github.com/algolia/api-clients-automation.
2
-
3
- import type { SearchParamsObject } from './searchParamsObject';
1
+ // 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.
4
2
 
5
3
  export type BaseRecommendRequest = {
6
4
  /**
7
- * The Algolia index name.
5
+ * Index name.
8
6
  */
9
7
  indexName: string;
10
8
 
11
9
  /**
12
- * The threshold to use when filtering recommendations by their score.
10
+ * Recommendations with a confidence score lower than `threshold` won\'t appear in results. > **Note**: Each recommendation has a confidence score of 0 to 100. The closer the score is to 100, the more relevant the recommendations are.
13
11
  */
14
- threshold: number;
12
+ threshold?: number;
15
13
 
16
14
  /**
17
- * The max number of recommendations to retrieve. If it\'s set to 0, all the recommendations of the objectID may be returned.
15
+ * Maximum number of recommendations to retrieve. If 0, all recommendations will be returned.
18
16
  */
19
17
  maxRecommendations?: number;
20
-
21
- queryParameters?: SearchParamsObject;
22
-
23
- fallbackParameters?: SearchParamsObject;
24
18
  };
@@ -0,0 +1,17 @@
1
+ // 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.
2
+
3
+ import type { RecommendationModels } from './recommendationModels';
4
+ import type { SearchParamsObject } from './searchParamsObject';
5
+
6
+ export type BaseRecommendationsQuery = {
7
+ model: RecommendationModels;
8
+
9
+ /**
10
+ * Unique record identifier.
11
+ */
12
+ objectID: string;
13
+
14
+ queryParameters?: SearchParamsObject;
15
+
16
+ fallbackParameters?: SearchParamsObject;
17
+ };
@@ -0,0 +1,12 @@
1
+ // 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.
2
+
3
+ import type { RecommendedForYouModel } from './recommendedForYouModel';
4
+ import type { RecommendedForYouQueryParameters } from './recommendedForYouQueryParameters';
5
+
6
+ export type BaseRecommendedForYouQuery = {
7
+ model: RecommendedForYouModel;
8
+
9
+ queryParameters?: RecommendedForYouQueryParameters;
10
+
11
+ fallbackParameters?: RecommendedForYouQueryParameters;
12
+ };
@@ -0,0 +1,8 @@
1
+ // 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.
2
+
3
+ export type BaseRecommendedForYouQueryParameters = {
4
+ /**
5
+ * Unique pseudonymous or anonymous user identifier. This helps with analytics and click and conversion events. For more information, see [user token](https://www.algolia.com/doc/guides/sending-events/concepts/usertoken/).
6
+ */
7
+ userToken: string;
8
+ };
@@ -1,4 +1,4 @@
1
- // This file is generated, manual changes will be lost - read more on https://github.com/algolia/api-clients-automation.
1
+ // 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.
2
2
 
3
3
  import type { BaseSearchParamsWithoutQuery } from './baseSearchParamsWithoutQuery';
4
4
  import type { SearchParamsQuery } from './searchParamsQuery';