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

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 (186) hide show
  1. package/dist/builds/browser.d.ts +1 -1
  2. package/dist/builds/node.d.ts +1 -1
  3. package/dist/model/autoFacetFilter.d.ts +14 -0
  4. package/dist/model/autoFacetFilter.d.ts.map +1 -0
  5. package/dist/model/baseRecommendRequest.d.ts +5 -3
  6. package/dist/model/baseRecommendRequest.d.ts.map +1 -1
  7. package/dist/model/baseSearchParamsWithoutQuery.d.ts +1 -1
  8. package/dist/model/boughtTogetherQuery.d.ts +4 -0
  9. package/dist/model/boughtTogetherQuery.d.ts.map +1 -0
  10. package/dist/model/clientMethodProps.d.ts +5 -5
  11. package/dist/model/condition.d.ts +5 -12
  12. package/dist/model/condition.d.ts.map +1 -1
  13. package/dist/model/consequence.d.ts +9 -17
  14. package/dist/model/consequence.d.ts.map +1 -1
  15. package/dist/model/deletedAtResponse.d.ts +1 -1
  16. package/dist/model/exactOnSingleWordQuery.d.ts +1 -1
  17. package/dist/model/fallbackParams.d.ts +3 -0
  18. package/dist/model/fallbackParams.d.ts.map +1 -0
  19. package/dist/model/fbtModel.d.ts +5 -0
  20. package/dist/model/fbtModel.d.ts.map +1 -0
  21. package/dist/model/frequentlyBoughtTogether.d.ts +9 -0
  22. package/dist/model/frequentlyBoughtTogether.d.ts.map +1 -0
  23. package/dist/model/getRecommendationsParams.d.ts +2 -2
  24. package/dist/model/hideConsequenceObject.d.ts +10 -0
  25. package/dist/model/hideConsequenceObject.d.ts.map +1 -0
  26. package/dist/model/index.d.ts +20 -23
  27. package/dist/model/index.d.ts.map +1 -1
  28. package/dist/model/indexSettingsAsSearchParams.d.ts +5 -5
  29. package/dist/model/lookingSimilar.d.ts +11 -0
  30. package/dist/model/lookingSimilar.d.ts.map +1 -0
  31. package/dist/model/lookingSimilarModel.d.ts +5 -0
  32. package/dist/model/lookingSimilarModel.d.ts.map +1 -0
  33. package/dist/model/lookingSimilarQuery.d.ts +4 -0
  34. package/dist/model/lookingSimilarQuery.d.ts.map +1 -0
  35. package/dist/model/paramsConsequence.d.ts +19 -0
  36. package/dist/model/paramsConsequence.d.ts.map +1 -0
  37. package/dist/model/promoteConsequenceObject.d.ts +14 -0
  38. package/dist/model/promoteConsequenceObject.d.ts.map +1 -0
  39. package/dist/model/recommendRule.d.ts +24 -0
  40. package/dist/model/recommendRule.d.ts.map +1 -0
  41. package/dist/model/recommendRuleMetadata.d.ts +10 -0
  42. package/dist/model/recommendRuleMetadata.d.ts.map +1 -0
  43. package/dist/model/recommendationsHits.d.ts +0 -8
  44. package/dist/model/recommendationsHits.d.ts.map +1 -1
  45. package/dist/model/recommendationsRequest.d.ts +4 -2
  46. package/dist/model/recommendationsRequest.d.ts.map +1 -1
  47. package/dist/model/recommendedForYou.d.ts +7 -0
  48. package/dist/model/recommendedForYou.d.ts.map +1 -0
  49. package/dist/model/recommendedForYouModel.d.ts +1 -1
  50. package/dist/model/recommendedForYouQuery.d.ts +2 -2
  51. package/dist/model/recommendedForYouQuery.d.ts.map +1 -1
  52. package/dist/model/relatedModel.d.ts +5 -0
  53. package/dist/model/relatedModel.d.ts.map +1 -0
  54. package/dist/model/relatedProducts.d.ts +11 -0
  55. package/dist/model/relatedProducts.d.ts.map +1 -0
  56. package/dist/model/relatedQuery.d.ts +4 -0
  57. package/dist/model/relatedQuery.d.ts.map +1 -0
  58. package/dist/model/removeWordsIfNoResults.d.ts +1 -1
  59. package/dist/model/searchParams.d.ts +3 -0
  60. package/dist/model/searchParams.d.ts.map +1 -0
  61. package/dist/model/searchRecommendRulesParams.d.ts +16 -4
  62. package/dist/model/searchRecommendRulesParams.d.ts.map +1 -1
  63. package/dist/model/searchRecommendRulesResponse.d.ts +3 -3
  64. package/dist/model/searchRecommendRulesResponse.d.ts.map +1 -1
  65. package/dist/model/sortRemainingBy.d.ts +1 -1
  66. package/dist/model/trendingFacetHit.d.ts +2 -2
  67. package/dist/model/trendingFacets.d.ts +11 -0
  68. package/dist/model/trendingFacets.d.ts.map +1 -0
  69. package/dist/model/trendingFacetsModel.d.ts +1 -1
  70. package/dist/model/trendingFacetsQuery.d.ts +2 -2
  71. package/dist/model/trendingFacetsQuery.d.ts.map +1 -1
  72. package/dist/model/trendingItems.d.ts +15 -0
  73. package/dist/model/trendingItems.d.ts.map +1 -0
  74. package/dist/model/trendingItemsModel.d.ts +1 -1
  75. package/dist/model/trendingItemsQuery.d.ts +2 -2
  76. package/dist/model/trendingItemsQuery.d.ts.map +1 -1
  77. package/dist/recommend.cjs +11 -11
  78. package/dist/recommend.esm.browser.js +11 -11
  79. package/dist/recommend.esm.node.js +11 -11
  80. package/dist/recommend.umd.js +2 -2
  81. package/dist/src/recommendClient.d.ts +13 -13
  82. package/dist/src/recommendClient.d.ts.map +1 -1
  83. package/model/autoFacetFilter.ts +16 -0
  84. package/model/baseRecommendRequest.ts +7 -3
  85. package/model/baseSearchParamsWithoutQuery.ts +1 -1
  86. package/model/{recommendationsQuery.ts → boughtTogetherQuery.ts} +3 -3
  87. package/model/clientMethodProps.ts +5 -5
  88. package/model/condition.ts +5 -16
  89. package/model/consequence.ts +9 -19
  90. package/model/deletedAtResponse.ts +1 -1
  91. package/model/exactOnSingleWordQuery.ts +1 -1
  92. package/model/{editType.ts → fallbackParams.ts} +3 -4
  93. package/model/fbtModel.ts +6 -0
  94. package/model/{consequenceHide.ts → frequentlyBoughtTogether.ts} +5 -4
  95. package/model/getRecommendationsParams.ts +2 -2
  96. package/model/{promoteObjectID.ts → hideConsequenceObject.ts} +3 -8
  97. package/model/index.ts +20 -23
  98. package/model/indexSettingsAsSearchParams.ts +5 -5
  99. package/model/lookingSimilar.ts +15 -0
  100. package/model/lookingSimilarModel.ts +6 -0
  101. package/model/lookingSimilarQuery.ts +6 -0
  102. package/model/paramsConsequence.ts +23 -0
  103. package/model/promoteConsequenceObject.ts +16 -0
  104. package/model/{ruleResponse.ts → recommendRule.ts} +7 -10
  105. package/model/{ruleResponseMetadata.ts → recommendRuleMetadata.ts} +5 -2
  106. package/model/recommendationsHits.ts +0 -10
  107. package/model/recommendationsRequest.ts +6 -2
  108. package/model/{baseRecommendedForYouQuery.ts → recommendedForYou.ts} +3 -5
  109. package/model/recommendedForYouModel.ts +1 -1
  110. package/model/recommendedForYouQuery.ts +2 -3
  111. package/model/relatedModel.ts +6 -0
  112. package/model/relatedProducts.ts +15 -0
  113. package/model/relatedQuery.ts +6 -0
  114. package/model/removeWordsIfNoResults.ts +1 -1
  115. package/model/{recommendationModels.ts → searchParams.ts} +3 -4
  116. package/model/searchRecommendRulesParams.ts +19 -4
  117. package/model/searchRecommendRulesResponse.ts +3 -3
  118. package/model/sortRemainingBy.ts +1 -1
  119. package/model/trendingFacetHit.ts +2 -2
  120. package/model/{baseTrendingFacetsQuery.ts → trendingFacets.ts} +7 -4
  121. package/model/trendingFacetsModel.ts +1 -1
  122. package/model/trendingFacetsQuery.ts +2 -3
  123. package/model/trendingItems.ts +20 -0
  124. package/model/trendingItemsModel.ts +1 -1
  125. package/model/trendingItemsQuery.ts +2 -2
  126. package/package.json +7 -7
  127. package/dist/model/anchoring.d.ts +0 -5
  128. package/dist/model/anchoring.d.ts.map +0 -1
  129. package/dist/model/automaticFacetFilter.d.ts +0 -18
  130. package/dist/model/automaticFacetFilter.d.ts.map +0 -1
  131. package/dist/model/automaticFacetFilters.d.ts +0 -6
  132. package/dist/model/automaticFacetFilters.d.ts.map +0 -1
  133. package/dist/model/baseRecommendationsQuery.d.ts +0 -12
  134. package/dist/model/baseRecommendationsQuery.d.ts.map +0 -1
  135. package/dist/model/baseRecommendedForYouQuery.d.ts +0 -8
  136. package/dist/model/baseRecommendedForYouQuery.d.ts.map +0 -1
  137. package/dist/model/baseRecommendedForYouQueryParameters.d.ts +0 -7
  138. package/dist/model/baseRecommendedForYouQueryParameters.d.ts.map +0 -1
  139. package/dist/model/baseTrendingFacetsQuery.d.ts +0 -9
  140. package/dist/model/baseTrendingFacetsQuery.d.ts.map +0 -1
  141. package/dist/model/baseTrendingItemsQuery.d.ts +0 -16
  142. package/dist/model/baseTrendingItemsQuery.d.ts.map +0 -1
  143. package/dist/model/consequenceHide.d.ts +0 -10
  144. package/dist/model/consequenceHide.d.ts.map +0 -1
  145. package/dist/model/consequenceParams.d.ts +0 -5
  146. package/dist/model/consequenceParams.d.ts.map +0 -1
  147. package/dist/model/consequenceQuery.d.ts +0 -6
  148. package/dist/model/consequenceQuery.d.ts.map +0 -1
  149. package/dist/model/consequenceQueryObject.d.ts +0 -12
  150. package/dist/model/consequenceQueryObject.d.ts.map +0 -1
  151. package/dist/model/edit.d.ts +0 -13
  152. package/dist/model/edit.d.ts.map +0 -1
  153. package/dist/model/editType.d.ts +0 -5
  154. package/dist/model/editType.d.ts.map +0 -1
  155. package/dist/model/params.d.ts +0 -13
  156. package/dist/model/params.d.ts.map +0 -1
  157. package/dist/model/promote.d.ts +0 -4
  158. package/dist/model/promote.d.ts.map +0 -1
  159. package/dist/model/promoteObjectID.d.ts +0 -14
  160. package/dist/model/promoteObjectID.d.ts.map +0 -1
  161. package/dist/model/promoteObjectIDs.d.ts +0 -14
  162. package/dist/model/promoteObjectIDs.d.ts.map +0 -1
  163. package/dist/model/recommendationModels.d.ts +0 -5
  164. package/dist/model/recommendationModels.d.ts.map +0 -1
  165. package/dist/model/recommendationsQuery.d.ts +0 -4
  166. package/dist/model/recommendationsQuery.d.ts.map +0 -1
  167. package/dist/model/recommendedForYouQueryParameters.d.ts +0 -4
  168. package/dist/model/recommendedForYouQueryParameters.d.ts.map +0 -1
  169. package/dist/model/ruleResponse.d.ts +0 -27
  170. package/dist/model/ruleResponse.d.ts.map +0 -1
  171. package/dist/model/ruleResponseMetadata.d.ts +0 -7
  172. package/dist/model/ruleResponseMetadata.d.ts.map +0 -1
  173. package/model/anchoring.ts +0 -6
  174. package/model/automaticFacetFilter.ts +0 -21
  175. package/model/automaticFacetFilters.ts +0 -8
  176. package/model/baseRecommendationsQuery.ts +0 -17
  177. package/model/baseRecommendedForYouQueryParameters.ts +0 -8
  178. package/model/baseTrendingItemsQuery.ts +0 -22
  179. package/model/consequenceParams.ts +0 -9
  180. package/model/consequenceQuery.ts +0 -8
  181. package/model/consequenceQueryObject.ts +0 -15
  182. package/model/edit.ts +0 -17
  183. package/model/params.ts +0 -18
  184. package/model/promote.ts +0 -6
  185. package/model/promoteObjectIDs.ts +0 -16
  186. package/model/recommendedForYouQueryParameters.ts +0 -7
@@ -1,2 +1,2 @@
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
+ /*! recommend.umd.js | 5.0.0-alpha.111 | © 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.111";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})}}));
@@ -4,9 +4,9 @@ import type { DeletedAtResponse } from '../model/deletedAtResponse';
4
4
  import type { GetRecommendTaskResponse } from '../model/getRecommendTaskResponse';
5
5
  import type { GetRecommendationsParams } from '../model/getRecommendationsParams';
6
6
  import type { GetRecommendationsResponse } from '../model/getRecommendationsResponse';
7
- import type { RuleResponse } from '../model/ruleResponse';
7
+ import type { RecommendRule } from '../model/recommendRule';
8
8
  import type { SearchRecommendRulesResponse } from '../model/searchRecommendRulesResponse';
9
- export declare const apiClientVersion = "5.0.0-alpha.110";
9
+ export declare const apiClientVersion = "5.0.0-alpha.111";
10
10
  export declare function createRecommendClient({ appId: appIdOption, apiKey: apiKeyOption, authMode, algoliaAgents, ...options }: CreateClientOptions): {
11
11
  transporter: import("@algolia/client-common").Transporter;
12
12
  /**
@@ -67,46 +67,46 @@ export declare function createRecommendClient({ appId: appIdOption, apiKey: apiK
67
67
  */
68
68
  customPut({ path, parameters, body }: CustomPutProps, requestOptions?: RequestOptions): Promise<Record<string, any>>;
69
69
  /**
70
- * Delete a [Recommend rule](https://www.algolia.com/doc/guides/algolia-recommend/how-to/rules/).
70
+ * Deletes a Recommend rule from a recommendation scenario.
71
71
  *
72
72
  * Required API Key ACLs:
73
73
  * - editSettings.
74
74
  *
75
75
  * @param deleteRecommendRule - The deleteRecommendRule object.
76
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).
77
+ * @param deleteRecommendRule.model - [Recommend model](https://www.algolia.com/doc/guides/algolia-recommend/overview/#recommend-models).
78
78
  * @param deleteRecommendRule.objectID - Unique record identifier.
79
79
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
80
80
  */
81
81
  deleteRecommendRule({ indexName, model, objectID }: DeleteRecommendRuleProps, requestOptions?: RequestOptions): Promise<DeletedAtResponse>;
82
82
  /**
83
- * Return a [Recommend rule](https://www.algolia.com/doc/guides/algolia-recommend/how-to/rules/).
83
+ * Retrieves a Recommend rule that you previously created in the Algolia dashboard.
84
84
  *
85
85
  * Required API Key ACLs:
86
86
  * - settings.
87
87
  *
88
88
  * @param getRecommendRule - The getRecommendRule object.
89
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).
90
+ * @param getRecommendRule.model - [Recommend model](https://www.algolia.com/doc/guides/algolia-recommend/overview/#recommend-models).
91
91
  * @param getRecommendRule.objectID - Unique record identifier.
92
92
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
93
93
  */
94
- getRecommendRule({ indexName, model, objectID }: GetRecommendRuleProps, requestOptions?: RequestOptions): Promise<RuleResponse>;
94
+ getRecommendRule({ indexName, model, objectID }: GetRecommendRuleProps, requestOptions?: RequestOptions): Promise<RecommendRule>;
95
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.
96
+ * 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.
97
97
  *
98
98
  * Required API Key ACLs:
99
99
  * - editSettings.
100
100
  *
101
101
  * @param getRecommendStatus - The getRecommendStatus object.
102
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).
103
+ * @param getRecommendStatus.model - [Recommend model](https://www.algolia.com/doc/guides/algolia-recommend/overview/#recommend-models).
104
+ * @param getRecommendStatus.taskID - Unique task identifier.
105
105
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
106
106
  */
107
107
  getRecommendStatus({ indexName, model, taskID }: GetRecommendStatusProps, requestOptions?: RequestOptions): Promise<GetRecommendTaskResponse>;
108
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).
109
+ * Retrieves recommendations from selected AI models.
110
110
  *
111
111
  * Required API Key ACLs:
112
112
  * - search.
@@ -116,14 +116,14 @@ export declare function createRecommendClient({ appId: appIdOption, apiKey: apiK
116
116
  */
117
117
  getRecommendations(getRecommendationsParams: GetRecommendationsParams, requestOptions?: RequestOptions): Promise<GetRecommendationsResponse>;
118
118
  /**
119
- * List [Recommend rules](https://www.algolia.com/doc/guides/algolia-recommend/how-to/rules/).
119
+ * Searches for Recommend rules. Use an empty query to list all rules for this recommendation scenario.
120
120
  *
121
121
  * Required API Key ACLs:
122
122
  * - settings.
123
123
  *
124
124
  * @param searchRecommendRules - The searchRecommendRules object.
125
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).
126
+ * @param searchRecommendRules.model - [Recommend model](https://www.algolia.com/doc/guides/algolia-recommend/overview/#recommend-models).
127
127
  * @param searchRecommendRules.searchRecommendRulesParams - The searchRecommendRulesParams object.
128
128
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
129
129
  */
@@ -1 +1 @@
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"}
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,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAC5D,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,aAAa,CAAC;IAqCzB;;;;;;;;;;;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"}
@@ -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
+ * Facet attribute. Only recommendations with the same value (or only recommendations with a different value) as the original viewed item are included.
5
+ */
6
+ export type AutoFacetFilter = {
7
+ /**
8
+ * Facet attribute.
9
+ */
10
+ facet?: string;
11
+
12
+ /**
13
+ * Whether the filter is negative. If true, recommendations must not have the same value for the `facet` attribute. If false, recommendations must have the same value for the `facet` attribute.
14
+ */
15
+ negative?: boolean;
16
+ };
@@ -1,5 +1,7 @@
1
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
+ import type { SearchParams } from './searchParams';
4
+
3
5
  export type BaseRecommendRequest = {
4
6
  /**
5
7
  * Index name.
@@ -7,12 +9,14 @@ export type BaseRecommendRequest = {
7
9
  indexName: string;
8
10
 
9
11
  /**
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.
12
+ * Minimum score a recommendation must have to be included in the response.
11
13
  */
12
- threshold?: number;
14
+ threshold: number;
13
15
 
14
16
  /**
15
- * Maximum number of recommendations to retrieve. If 0, all recommendations will be returned.
17
+ * Maximum number of recommendations to retrieve. By default, all recommendations are returned and no fallback request is made. Depending on the available recommendations and the other request parameters, the actual number of recommendations may be lower than this value.
16
18
  */
17
19
  maxRecommendations?: number;
20
+
21
+ queryParameters?: SearchParams;
18
22
  };
@@ -14,7 +14,7 @@ export type BaseSearchParamsWithoutQuery = {
14
14
  similarQuery?: string;
15
15
 
16
16
  /**
17
- * Filter the search so that only records with matching values are included in the results. These filters are supported: - **Numeric filters.** `<facet> <op> <number>`, where `<op>` is one of `<`, `<=`, `=`, `!=`, `>`, `>=`. - **Ranges.** `<facet>:<lower> TO <upper>` where `<lower>` and `<upper>` are the lower and upper limits of the range (inclusive). - **Facet filters.** `<facet>:<value>` where `<facet>` is a facet attribute (case-sensitive) and `<value>` a facet value. - **Tag filters.** `_tags:<value>` or just `<value>` (case-sensitive). - **Boolean filters.** `<facet>: true | false`. You can combine filters with `AND`, `OR`, and `NOT` operators with the following restrictions: - You can only combine filters of the same type with `OR`. **Not supported:** `facet:value OR num > 3`. - You can\'t use `NOT` with combinations of filters. **Not supported:** `NOT(facet:value OR facet:value)` - You can\'t combine conjunctions (`AND`) with `OR`. **Not supported:** `facet:value OR (facet:value AND facet:value)` Use quotes around your filters, if the facet attribute name or facet value has spaces, keywords (`OR`, `AND`, `NOT`), or quotes. If a facet attribute is an array, the filter matches if it matches at least one element of the array. For more information, see [Filters](https://www.algolia.com/doc/guides/managing-results/refine-results/filtering/).
17
+ * Filter expression to only include items that match the filter criteria in the response. You can use these filter expressions: - **Numeric filters.** `<facet> <op> <number>`, where `<op>` is one of `<`, `<=`, `=`, `!=`, `>`, `>=`. - **Ranges.** `<facet>:<lower> TO <upper>` where `<lower>` and `<upper>` are the lower and upper limits of the range (inclusive). - **Facet filters.** `<facet>:<value>` where `<facet>` is a facet attribute (case-sensitive) and `<value>` a facet value. - **Tag filters.** `_tags:<value>` or just `<value>` (case-sensitive). - **Boolean filters.** `<facet>: true | false`. You can combine filters with `AND`, `OR`, and `NOT` operators with the following restrictions: - You can only combine filters of the same type with `OR`. **Not supported:** `facet:value OR num > 3`. - You can\'t use `NOT` with combinations of filters. **Not supported:** `NOT(facet:value OR facet:value)` - You can\'t combine conjunctions (`AND`) with `OR`. **Not supported:** `facet:value OR (facet:value AND facet:value)` Use quotes around your filters, if the facet attribute name or facet value has spaces, keywords (`OR`, `AND`, `NOT`), or quotes. If a facet attribute is an array, the filter matches if it matches at least one element of the array. For more information, see [Filters](https://www.algolia.com/doc/guides/managing-results/refine-results/filtering/).
18
18
  */
19
19
  filters?: string;
20
20
 
@@ -1,7 +1,7 @@
1
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 { BaseRecommendRequest } from './baseRecommendRequest';
4
- import type { BaseRecommendationsQuery } from './baseRecommendationsQuery';
4
+ import type { FrequentlyBoughtTogether } from './frequentlyBoughtTogether';
5
5
 
6
- export type RecommendationsQuery = BaseRecommendationsQuery &
7
- BaseRecommendRequest;
6
+ export type BoughtTogetherQuery = BaseRecommendRequest &
7
+ FrequentlyBoughtTogether;
@@ -76,7 +76,7 @@ export type DeleteRecommendRuleProps = {
76
76
  */
77
77
  indexName: string;
78
78
  /**
79
- * [Recommend models](https://www.algolia.com/doc/guides/algolia-recommend/overview/#recommend-models).
79
+ * [Recommend model](https://www.algolia.com/doc/guides/algolia-recommend/overview/#recommend-models).
80
80
  */
81
81
  model: RecommendModels;
82
82
  /**
@@ -94,7 +94,7 @@ export type GetRecommendRuleProps = {
94
94
  */
95
95
  indexName: string;
96
96
  /**
97
- * [Recommend models](https://www.algolia.com/doc/guides/algolia-recommend/overview/#recommend-models).
97
+ * [Recommend model](https://www.algolia.com/doc/guides/algolia-recommend/overview/#recommend-models).
98
98
  */
99
99
  model: RecommendModels;
100
100
  /**
@@ -112,11 +112,11 @@ export type GetRecommendStatusProps = {
112
112
  */
113
113
  indexName: string;
114
114
  /**
115
- * [Recommend models](https://www.algolia.com/doc/guides/algolia-recommend/overview/#recommend-models).
115
+ * [Recommend model](https://www.algolia.com/doc/guides/algolia-recommend/overview/#recommend-models).
116
116
  */
117
117
  model: RecommendModels;
118
118
  /**
119
- * Unique identifier of a task. Numeric value (up to 64bits).
119
+ * Unique task identifier.
120
120
  */
121
121
  taskID: number;
122
122
  };
@@ -130,7 +130,7 @@ export type SearchRecommendRulesProps = {
130
130
  */
131
131
  indexName: string;
132
132
  /**
133
- * [Recommend models](https://www.algolia.com/doc/guides/algolia-recommend/overview/#recommend-models).
133
+ * [Recommend model](https://www.algolia.com/doc/guides/algolia-recommend/overview/#recommend-models).
134
134
  */
135
135
  model: RecommendModels;
136
136
  searchRecommendRulesParams?: SearchRecommendRulesParams;
@@ -1,27 +1,16 @@
1
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
- import type { Anchoring } from './anchoring';
4
-
3
+ /**
4
+ * Condition that triggers the rule. If not specified, the rule is triggered for all recommendations.
5
+ */
5
6
  export type Condition = {
6
7
  /**
7
- * Query pattern that triggers the rule. You can use either a literal string, or a special pattern `{facet:ATTRIBUTE}`, where `ATTRIBUTE` is a facet name. The rule is triggered if the query matches the literal string or a value of the specified facet. For example, with `pattern: {facet:genre}`, the rule is triggered when users search for a genre, such as \"comedy\".
8
- */
9
- pattern?: string;
10
-
11
- anchoring?: Anchoring;
12
-
13
- /**
14
- * Whether the pattern should match plurals, synonyms, and typos.
8
+ * Filter expression to only include items that match the filter criteria in the response. You can use these filter expressions: - **Numeric filters.** `<facet> <op> <number>`, where `<op>` is one of `<`, `<=`, `=`, `!=`, `>`, `>=`. - **Ranges.** `<facet>:<lower> TO <upper>` where `<lower>` and `<upper>` are the lower and upper limits of the range (inclusive). - **Facet filters.** `<facet>:<value>` where `<facet>` is a facet attribute (case-sensitive) and `<value>` a facet value. - **Tag filters.** `_tags:<value>` or just `<value>` (case-sensitive). - **Boolean filters.** `<facet>: true | false`. You can combine filters with `AND`, `OR`, and `NOT` operators with the following restrictions: - You can only combine filters of the same type with `OR`. **Not supported:** `facet:value OR num > 3`. - You can\'t use `NOT` with combinations of filters. **Not supported:** `NOT(facet:value OR facet:value)` - You can\'t combine conjunctions (`AND`) with `OR`. **Not supported:** `facet:value OR (facet:value AND facet:value)` Use quotes around your filters, if the facet attribute name or facet value has spaces, keywords (`OR`, `AND`, `NOT`), or quotes. If a facet attribute is an array, the filter matches if it matches at least one element of the array. For more information, see [Filters](https://www.algolia.com/doc/guides/managing-results/refine-results/filtering/).
15
9
  */
16
- alternatives?: boolean;
10
+ filters?: string;
17
11
 
18
12
  /**
19
13
  * An additional restriction that only triggers the rule, when the search has the same value as `ruleContexts` parameter. For example, if `context: mobile`, the rule is only triggered when the search request has a matching `ruleContexts: mobile`. A rule context must only contain alphanumeric characters.
20
14
  */
21
15
  context?: string;
22
-
23
- /**
24
- * Filters that trigger the rule. You can add add filters using the syntax `facet:value` so that the rule is triggered, when the specific filter is selected. You can use `filters` on its own or combine it with the `pattern` parameter.
25
- */
26
- filters?: string;
27
16
  };
@@ -1,32 +1,22 @@
1
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
- import type { ConsequenceHide } from './consequenceHide';
4
- import type { ConsequenceParams } from './consequenceParams';
5
- import type { Promote } from './promote';
3
+ import type { HideConsequenceObject } from './hideConsequenceObject';
4
+ import type { ParamsConsequence } from './paramsConsequence';
5
+ import type { PromoteConsequenceObject } from './promoteConsequenceObject';
6
6
 
7
7
  /**
8
- * Effect of the rule. For more information, see [Consequences](https://www.algolia.com/doc/guides/managing-results/rules/rules-overview/#consequences).
8
+ * Effect of the rule.
9
9
  */
10
10
  export type Consequence = {
11
- params?: ConsequenceParams;
12
-
13
- /**
14
- * Records you want to pin to a specific position in the search results. You can promote up to 300 records, either individually, or as groups of up to 100 records each.
15
- */
16
- promote?: Promote[];
17
-
18
11
  /**
19
- * Whether promoted records must match an active filter for the consequence to be applied. This ensures that user actions (filtering the search) are given a higher precendence. For example, if you promote a record with the `color: red` attribute, and the user filters the search for `color: blue`, the \"red\" record won\'t be shown.
12
+ * Exclude items from recommendations.
20
13
  */
21
- filterPromotes?: boolean;
14
+ hide?: HideConsequenceObject[];
22
15
 
23
16
  /**
24
- * Records you want to hide from the search results.
17
+ * Place items at specific positions in the list of recommendations.
25
18
  */
26
- hide?: ConsequenceHide[];
19
+ promote?: PromoteConsequenceObject[];
27
20
 
28
- /**
29
- * A JSON object with custom data that will be appended to the `userData` array in the response. This object isn\'t interpreted by the API and is limited to 1&nbsp;kB of minified JSON.
30
- */
31
- userData?: any | null;
21
+ params?: ParamsConsequence;
32
22
  };
@@ -10,7 +10,7 @@ export type DeletedAtResponse = {
10
10
  taskID: number;
11
11
 
12
12
  /**
13
- * Timestamp of deletion in [ISO 8601](https://wikipedia.org/wiki/ISO_8601) format.
13
+ * Date and time when the object was deleted, in RFC 3339 format.
14
14
  */
15
15
  deletedAt: string;
16
16
  };
@@ -1,6 +1,6 @@
1
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
  /**
4
- * Determines how the [Exact ranking criterion](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/override-search-engine-defaults/in-depth/adjust-exact-settings/#turn-off-exact-for-some-attributes) is computed when the search query has only one word. <dl> <dt><code>attribute</code></dt> <dd> The Exact ranking criterion is 1 if the query word and attribute value are the same. For example, a search for \"road\" will match the value \"road\", but not \"road trip\". </dd> <dt><code>none</code></dt> <dd> The Exact ranking criterion is ignored on single-word searches. </dd> <dt><code>word</code></dt> <dd> The Exact ranking criterion is 1 if the query word is found in the attribute value. The query word must have at least 3 characters and must not be a stop word. </dd> </dl> If `exactOnSingleWordQuery` is `word`, only exact matches will be highlighted, partial and prefix matches won\'t.
4
+ * Determines how the [Exact ranking criterion](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/override-search-engine-defaults/in-depth/adjust-exact-settings/#turn-off-exact-for-some-attributes) is computed when the search query has only one word. - `attribute`. The Exact ranking criterion is 1 if the query word and attribute value are the same. For example, a search for \"road\" will match the value \"road\", but not \"road trip\". - `none`. The Exact ranking criterion is ignored on single-word searches. - `word`. The Exact ranking criterion is 1 if the query word is found in the attribute value. The query word must have at least 3 characters and must not be a stop word. Only exact matches will be highlighted, partial and prefix matches won\'t.
5
5
  */
6
6
  export type ExactOnSingleWordQuery = 'attribute' | 'none' | 'word';
@@ -1,6 +1,5 @@
1
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
- * Type of edit.
5
- */
6
- export type EditType = 'remove' | 'replace';
3
+ import type { SearchParamsObject } from './searchParamsObject';
4
+
5
+ export type FallbackParams = Record<string, any> & SearchParamsObject;
@@ -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
+ * Frequently bought together model. This model recommends items that have been purchased within 1 day with the item with the ID `objectID`.
5
+ */
6
+ export type FbtModel = 'bought-together';
@@ -1,9 +1,10 @@
1
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
- * Object ID of the record to hide.
5
- */
6
- export type ConsequenceHide = {
3
+ import type { FbtModel } from './fbtModel';
4
+
5
+ export type FrequentlyBoughtTogether = {
6
+ model: FbtModel;
7
+
7
8
  /**
8
9
  * Unique record identifier.
9
10
  */
@@ -3,11 +3,11 @@
3
3
  import type { RecommendationsRequest } from './recommendationsRequest';
4
4
 
5
5
  /**
6
- * Recommend parameters.
6
+ * Recommend request body.
7
7
  */
8
8
  export type GetRecommendationsParams = {
9
9
  /**
10
- * Request parameters depend on the model (recommendations or trending).
10
+ * Recommendation request with parameters depending on the requested model.
11
11
  */
12
12
  requests: RecommendationsRequest[];
13
13
  };
@@ -1,16 +1,11 @@
1
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
  /**
4
- * Record to promote.
4
+ * Object ID of the recommendation you want to exclude.
5
5
  */
6
- export type PromoteObjectID = {
6
+ export type HideConsequenceObject = {
7
7
  /**
8
8
  * Unique record identifier.
9
9
  */
10
- objectID: string;
11
-
12
- /**
13
- * Position in the search results where you want to show the promoted records.
14
- */
15
- position: number;
10
+ objectID?: string;
16
11
  };
package/model/index.ts CHANGED
@@ -2,32 +2,20 @@
2
2
 
3
3
  export * from './advancedSyntaxFeatures';
4
4
  export * from './alternativesAsExact';
5
- export * from './anchoring';
6
5
  export * from './aroundPrecision';
7
6
  export * from './aroundPrecisionFromValueInner';
8
7
  export * from './aroundRadius';
9
8
  export * from './aroundRadiusAll';
10
- export * from './automaticFacetFilter';
11
- export * from './automaticFacetFilters';
9
+ export * from './autoFacetFilter';
12
10
  export * from './baseRecommendRequest';
13
- export * from './baseRecommendationsQuery';
14
- export * from './baseRecommendedForYouQuery';
15
- export * from './baseRecommendedForYouQueryParameters';
16
11
  export * from './baseSearchParams';
17
12
  export * from './baseSearchParamsWithoutQuery';
18
13
  export * from './baseSearchResponse';
19
- export * from './baseTrendingFacetsQuery';
20
- export * from './baseTrendingItemsQuery';
14
+ export * from './boughtTogetherQuery';
21
15
  export * from './condition';
22
16
  export * from './consequence';
23
- export * from './consequenceHide';
24
- export * from './consequenceParams';
25
- export * from './consequenceQuery';
26
- export * from './consequenceQueryObject';
27
17
  export * from './deletedAtResponse';
28
18
  export * from './distinct';
29
- export * from './edit';
30
- export * from './editType';
31
19
  export * from './errorBase';
32
20
  export * from './exactOnSingleWordQuery';
33
21
  export * from './exhaustive';
@@ -35,46 +23,53 @@ export * from './facetFilters';
35
23
  export * from './facetOrdering';
36
24
  export * from './facets';
37
25
  export * from './facetsStats';
26
+ export * from './fallbackParams';
27
+ export * from './fbtModel';
28
+ export * from './frequentlyBoughtTogether';
38
29
  export * from './getRecommendTaskResponse';
39
30
  export * from './getRecommendationsParams';
40
31
  export * from './getRecommendationsResponse';
32
+ export * from './hideConsequenceObject';
41
33
  export * from './highlightResult';
42
34
  export * from './highlightResultOption';
43
35
  export * from './ignorePlurals';
44
36
  export * from './indexSettingsAsSearchParams';
37
+ export * from './lookingSimilar';
38
+ export * from './lookingSimilarModel';
39
+ export * from './lookingSimilarQuery';
45
40
  export * from './matchLevel';
46
41
  export * from './matchedGeoLocation';
47
42
  export * from './mixedSearchFilters';
48
43
  export * from './mode';
49
44
  export * from './numericFilters';
50
45
  export * from './optionalFilters';
51
- export * from './params';
46
+ export * from './paramsConsequence';
52
47
  export * from './personalization';
53
- export * from './promote';
54
- export * from './promoteObjectID';
55
- export * from './promoteObjectIDs';
48
+ export * from './promoteConsequenceObject';
56
49
  export * from './queryType';
57
50
  export * from './rankingInfo';
58
51
  export * from './reRankingApplyFilter';
59
52
  export * from './recommendHit';
60
53
  export * from './recommendModels';
61
- export * from './recommendationModels';
54
+ export * from './recommendRule';
55
+ export * from './recommendRuleMetadata';
62
56
  export * from './recommendationsHit';
63
57
  export * from './recommendationsHits';
64
- export * from './recommendationsQuery';
65
58
  export * from './recommendationsRequest';
66
59
  export * from './recommendationsResults';
60
+ export * from './recommendedForYou';
67
61
  export * from './recommendedForYouModel';
68
62
  export * from './recommendedForYouQuery';
69
- export * from './recommendedForYouQueryParameters';
70
63
  export * from './redirect';
71
64
  export * from './redirectRuleIndexMetadata';
72
65
  export * from './redirectRuleIndexMetadataData';
66
+ export * from './relatedModel';
67
+ export * from './relatedProducts';
68
+ export * from './relatedQuery';
73
69
  export * from './removeStopWords';
74
70
  export * from './removeWordsIfNoResults';
75
71
  export * from './renderingContent';
76
- export * from './ruleResponse';
77
- export * from './ruleResponseMetadata';
72
+ export * from './searchParams';
78
73
  export * from './searchParamsObject';
79
74
  export * from './searchParamsQuery';
80
75
  export * from './searchRecommendRulesParams';
@@ -87,8 +82,10 @@ export * from './supportedLanguage';
87
82
  export * from './tagFilters';
88
83
  export * from './taskStatus';
89
84
  export * from './trendingFacetHit';
85
+ export * from './trendingFacets';
90
86
  export * from './trendingFacetsModel';
91
87
  export * from './trendingFacetsQuery';
88
+ export * from './trendingItems';
92
89
  export * from './trendingItemsModel';
93
90
  export * from './trendingItemsQuery';
94
91
  export * from './typoTolerance';