@algolia/recommend 5.0.0-alpha.98 → 5.0.0-beta.1

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 (268) hide show
  1. package/dist/builds/browser.d.ts +21 -3
  2. package/dist/builds/browser.d.ts.map +1 -1
  3. package/dist/builds/node.d.ts +21 -3
  4. package/dist/builds/node.d.ts.map +1 -1
  5. package/dist/model/aroundPrecision.d.ts +1 -1
  6. package/dist/model/aroundPrecisionFromValueInner.d.ts +9 -0
  7. package/dist/model/aroundPrecisionFromValueInner.d.ts.map +1 -1
  8. package/dist/model/aroundRadius.d.ts +1 -1
  9. package/dist/model/aroundRadiusAll.d.ts +3 -0
  10. package/dist/model/aroundRadiusAll.d.ts.map +1 -1
  11. package/dist/model/autoFacetFilter.d.ts +14 -0
  12. package/dist/model/autoFacetFilter.d.ts.map +1 -0
  13. package/dist/model/baseRecommendRequest.d.ts +6 -4
  14. package/dist/model/baseRecommendRequest.d.ts.map +1 -1
  15. package/dist/model/baseSearchParamsWithoutQuery.d.ts +26 -29
  16. package/dist/model/baseSearchParamsWithoutQuery.d.ts.map +1 -1
  17. package/dist/model/baseSearchResponse.d.ts +10 -6
  18. package/dist/model/baseSearchResponse.d.ts.map +1 -1
  19. package/dist/model/boughtTogetherQuery.d.ts +4 -0
  20. package/dist/model/boughtTogetherQuery.d.ts.map +1 -0
  21. package/dist/model/clientMethodProps.d.ts +11 -11
  22. package/dist/model/condition.d.ts +6 -9
  23. package/dist/model/condition.d.ts.map +1 -1
  24. package/dist/model/consequence.d.ts +9 -17
  25. package/dist/model/consequence.d.ts.map +1 -1
  26. package/dist/model/deletedAtResponse.d.ts +2 -2
  27. package/dist/model/distinct.d.ts +1 -1
  28. package/dist/model/exactOnSingleWordQuery.d.ts +1 -1
  29. package/dist/model/facetFilters.d.ts +1 -1
  30. package/dist/model/facetOrdering.d.ts +2 -2
  31. package/dist/model/facets.d.ts +2 -2
  32. package/dist/model/fallbackParams.d.ts +3 -0
  33. package/dist/model/fallbackParams.d.ts.map +1 -0
  34. package/dist/model/fbtModel.d.ts +5 -0
  35. package/dist/model/fbtModel.d.ts.map +1 -0
  36. package/dist/model/frequentlyBoughtTogether.d.ts +9 -0
  37. package/dist/model/frequentlyBoughtTogether.d.ts.map +1 -0
  38. package/dist/model/getRecommendationsParams.d.ts +2 -2
  39. package/dist/model/hideConsequenceObject.d.ts +10 -0
  40. package/dist/model/hideConsequenceObject.d.ts.map +1 -0
  41. package/dist/model/highlightResult.d.ts +1 -1
  42. package/dist/model/highlightResult.d.ts.map +1 -1
  43. package/dist/model/highlightResultOption.d.ts +3 -3
  44. package/dist/model/ignorePlurals.d.ts +3 -2
  45. package/dist/model/ignorePlurals.d.ts.map +1 -1
  46. package/dist/model/index.d.ts +21 -23
  47. package/dist/model/index.d.ts.map +1 -1
  48. package/dist/model/indexSettingsAsSearchParams.d.ts +32 -35
  49. package/dist/model/indexSettingsAsSearchParams.d.ts.map +1 -1
  50. package/dist/model/lookingSimilar.d.ts +11 -0
  51. package/dist/model/lookingSimilar.d.ts.map +1 -0
  52. package/dist/model/lookingSimilarModel.d.ts +5 -0
  53. package/dist/model/lookingSimilarModel.d.ts.map +1 -0
  54. package/dist/model/lookingSimilarQuery.d.ts +4 -0
  55. package/dist/model/lookingSimilarQuery.d.ts.map +1 -0
  56. package/dist/model/matchLevel.d.ts +1 -1
  57. package/dist/model/mode.d.ts +1 -1
  58. package/dist/model/numericFilters.d.ts +1 -1
  59. package/dist/model/optionalFilters.d.ts +1 -1
  60. package/dist/model/paramsConsequence.d.ts +19 -0
  61. package/dist/model/paramsConsequence.d.ts.map +1 -0
  62. package/dist/model/promoteConsequenceObject.d.ts +14 -0
  63. package/dist/model/promoteConsequenceObject.d.ts.map +1 -0
  64. package/dist/model/queryType.d.ts +1 -1
  65. package/dist/model/rankingInfo.d.ts +10 -7
  66. package/dist/model/rankingInfo.d.ts.map +1 -1
  67. package/dist/model/reRankingApplyFilter.d.ts +1 -1
  68. package/dist/model/recommendHit.d.ts +3 -3
  69. package/dist/model/recommendRule.d.ts +24 -0
  70. package/dist/model/recommendRule.d.ts.map +1 -0
  71. package/dist/model/recommendRuleMetadata.d.ts +10 -0
  72. package/dist/model/recommendRuleMetadata.d.ts.map +1 -0
  73. package/dist/model/recommendationsHits.d.ts +0 -8
  74. package/dist/model/recommendationsHits.d.ts.map +1 -1
  75. package/dist/model/recommendationsRequest.d.ts +4 -2
  76. package/dist/model/recommendationsRequest.d.ts.map +1 -1
  77. package/dist/model/recommendedForYou.d.ts +7 -0
  78. package/dist/model/recommendedForYou.d.ts.map +1 -0
  79. package/dist/model/recommendedForYouModel.d.ts +1 -1
  80. package/dist/model/recommendedForYouQuery.d.ts +2 -2
  81. package/dist/model/recommendedForYouQuery.d.ts.map +1 -1
  82. package/dist/model/relatedModel.d.ts +5 -0
  83. package/dist/model/relatedModel.d.ts.map +1 -0
  84. package/dist/model/relatedProducts.d.ts +11 -0
  85. package/dist/model/relatedProducts.d.ts.map +1 -0
  86. package/dist/model/relatedQuery.d.ts +4 -0
  87. package/dist/model/relatedQuery.d.ts.map +1 -0
  88. package/dist/model/removeStopWords.d.ts +3 -2
  89. package/dist/model/removeStopWords.d.ts.map +1 -1
  90. package/dist/model/removeWordsIfNoResults.d.ts +1 -1
  91. package/dist/model/renderingContent.d.ts +1 -1
  92. package/dist/model/searchParams.d.ts +3 -0
  93. package/dist/model/searchParams.d.ts.map +1 -0
  94. package/dist/model/searchParamsObject.d.ts +3 -0
  95. package/dist/model/searchParamsObject.d.ts.map +1 -1
  96. package/dist/model/searchParamsQuery.d.ts +1 -1
  97. package/dist/model/searchRecommendRulesParams.d.ts +18 -6
  98. package/dist/model/searchRecommendRulesParams.d.ts.map +1 -1
  99. package/dist/model/searchRecommendRulesResponse.d.ts +6 -6
  100. package/dist/model/searchRecommendRulesResponse.d.ts.map +1 -1
  101. package/dist/model/semanticSearch.d.ts +2 -2
  102. package/dist/model/snippetResult.d.ts +1 -1
  103. package/dist/model/snippetResult.d.ts.map +1 -1
  104. package/dist/model/snippetResultOption.d.ts +2 -2
  105. package/dist/model/sortRemainingBy.d.ts +1 -1
  106. package/dist/model/supportedLanguage.d.ts +5 -0
  107. package/dist/model/supportedLanguage.d.ts.map +1 -0
  108. package/dist/model/tagFilters.d.ts +1 -1
  109. package/dist/model/taskStatus.d.ts +1 -1
  110. package/dist/model/trendingFacetHit.d.ts +2 -2
  111. package/dist/model/trendingFacets.d.ts +11 -0
  112. package/dist/model/trendingFacets.d.ts.map +1 -0
  113. package/dist/model/trendingFacetsModel.d.ts +1 -1
  114. package/dist/model/trendingFacetsQuery.d.ts +2 -2
  115. package/dist/model/trendingFacetsQuery.d.ts.map +1 -1
  116. package/dist/model/trendingItems.d.ts +15 -0
  117. package/dist/model/trendingItems.d.ts.map +1 -0
  118. package/dist/model/trendingItemsModel.d.ts +1 -1
  119. package/dist/model/trendingItemsQuery.d.ts +2 -2
  120. package/dist/model/trendingItemsQuery.d.ts.map +1 -1
  121. package/dist/model/typoTolerance.d.ts +1 -1
  122. package/dist/model/typoToleranceEnum.d.ts +3 -0
  123. package/dist/model/typoToleranceEnum.d.ts.map +1 -1
  124. package/dist/model/value.d.ts +1 -1
  125. package/dist/recommend.cjs +54 -45
  126. package/dist/recommend.esm.browser.js +42 -38
  127. package/dist/recommend.esm.node.js +54 -45
  128. package/dist/recommend.umd.js +2 -2
  129. package/dist/src/recommendClient.d.ts +34 -32
  130. package/dist/src/recommendClient.d.ts.map +1 -1
  131. package/model/aroundPrecision.ts +1 -1
  132. package/model/aroundPrecisionFromValueInner.ts +9 -0
  133. package/model/aroundRadius.ts +1 -1
  134. package/model/aroundRadiusAll.ts +3 -0
  135. package/model/autoFacetFilter.ts +16 -0
  136. package/model/baseRecommendRequest.ts +8 -4
  137. package/model/baseSearchParamsWithoutQuery.ts +26 -30
  138. package/model/baseSearchResponse.ts +11 -6
  139. package/model/{recommendationsQuery.ts → boughtTogetherQuery.ts} +3 -3
  140. package/model/clientMethodProps.ts +11 -11
  141. package/model/condition.ts +6 -12
  142. package/model/consequence.ts +9 -19
  143. package/model/deletedAtResponse.ts +2 -2
  144. package/model/distinct.ts +1 -1
  145. package/model/exactOnSingleWordQuery.ts +1 -1
  146. package/model/facetFilters.ts +1 -1
  147. package/model/facetOrdering.ts +2 -2
  148. package/model/facets.ts +2 -2
  149. package/model/{editType.ts → fallbackParams.ts} +3 -4
  150. package/model/fbtModel.ts +6 -0
  151. package/model/{consequenceHide.ts → frequentlyBoughtTogether.ts} +6 -5
  152. package/model/getRecommendationsParams.ts +2 -2
  153. package/model/hideConsequenceObject.ts +11 -0
  154. package/model/highlightResult.ts +1 -0
  155. package/model/highlightResultOption.ts +3 -3
  156. package/model/ignorePlurals.ts +4 -2
  157. package/model/index.ts +21 -23
  158. package/model/indexSettingsAsSearchParams.ts +32 -36
  159. package/model/lookingSimilar.ts +15 -0
  160. package/model/lookingSimilarModel.ts +6 -0
  161. package/model/lookingSimilarQuery.ts +6 -0
  162. package/model/matchLevel.ts +1 -1
  163. package/model/mode.ts +1 -1
  164. package/model/numericFilters.ts +1 -1
  165. package/model/optionalFilters.ts +1 -1
  166. package/model/paramsConsequence.ts +23 -0
  167. package/model/promoteConsequenceObject.ts +16 -0
  168. package/model/queryType.ts +1 -1
  169. package/model/rankingInfo.ts +10 -7
  170. package/model/reRankingApplyFilter.ts +1 -1
  171. package/model/recommendHit.ts +3 -3
  172. package/model/{ruleResponse.ts → recommendRule.ts} +7 -10
  173. package/model/{ruleResponseMetadata.ts → recommendRuleMetadata.ts} +5 -2
  174. package/model/recommendationsHits.ts +0 -10
  175. package/model/recommendationsRequest.ts +6 -2
  176. package/model/{baseRecommendedForYouQuery.ts → recommendedForYou.ts} +3 -5
  177. package/model/recommendedForYouModel.ts +1 -1
  178. package/model/recommendedForYouQuery.ts +2 -3
  179. package/model/relatedModel.ts +6 -0
  180. package/model/relatedProducts.ts +15 -0
  181. package/model/relatedQuery.ts +6 -0
  182. package/model/removeStopWords.ts +4 -2
  183. package/model/removeWordsIfNoResults.ts +1 -1
  184. package/model/renderingContent.ts +1 -1
  185. package/model/{recommendationModels.ts → searchParams.ts} +3 -4
  186. package/model/searchParamsObject.ts +3 -0
  187. package/model/searchParamsQuery.ts +1 -1
  188. package/model/searchRecommendRulesParams.ts +21 -6
  189. package/model/searchRecommendRulesResponse.ts +6 -6
  190. package/model/semanticSearch.ts +2 -2
  191. package/model/snippetResult.ts +2 -1
  192. package/model/snippetResultOption.ts +2 -2
  193. package/model/sortRemainingBy.ts +1 -1
  194. package/model/supportedLanguage.ts +74 -0
  195. package/model/tagFilters.ts +1 -1
  196. package/model/taskStatus.ts +1 -1
  197. package/model/trendingFacetHit.ts +2 -2
  198. package/model/{baseTrendingFacetsQuery.ts → trendingFacets.ts} +7 -4
  199. package/model/trendingFacetsModel.ts +1 -1
  200. package/model/trendingFacetsQuery.ts +2 -3
  201. package/model/trendingItems.ts +20 -0
  202. package/model/trendingItemsModel.ts +1 -1
  203. package/model/trendingItemsQuery.ts +2 -2
  204. package/model/typoTolerance.ts +1 -1
  205. package/model/typoToleranceEnum.ts +3 -0
  206. package/model/value.ts +1 -1
  207. package/package.json +7 -7
  208. package/dist/model/anchoring.d.ts +0 -5
  209. package/dist/model/anchoring.d.ts.map +0 -1
  210. package/dist/model/automaticFacetFilter.d.ts +0 -18
  211. package/dist/model/automaticFacetFilter.d.ts.map +0 -1
  212. package/dist/model/automaticFacetFilters.d.ts +0 -6
  213. package/dist/model/automaticFacetFilters.d.ts.map +0 -1
  214. package/dist/model/baseRecommendationsQuery.d.ts +0 -12
  215. package/dist/model/baseRecommendationsQuery.d.ts.map +0 -1
  216. package/dist/model/baseRecommendedForYouQuery.d.ts +0 -8
  217. package/dist/model/baseRecommendedForYouQuery.d.ts.map +0 -1
  218. package/dist/model/baseRecommendedForYouQueryParameters.d.ts +0 -7
  219. package/dist/model/baseRecommendedForYouQueryParameters.d.ts.map +0 -1
  220. package/dist/model/baseTrendingFacetsQuery.d.ts +0 -9
  221. package/dist/model/baseTrendingFacetsQuery.d.ts.map +0 -1
  222. package/dist/model/baseTrendingItemsQuery.d.ts +0 -16
  223. package/dist/model/baseTrendingItemsQuery.d.ts.map +0 -1
  224. package/dist/model/consequenceHide.d.ts +0 -10
  225. package/dist/model/consequenceHide.d.ts.map +0 -1
  226. package/dist/model/consequenceParams.d.ts +0 -5
  227. package/dist/model/consequenceParams.d.ts.map +0 -1
  228. package/dist/model/consequenceQuery.d.ts +0 -6
  229. package/dist/model/consequenceQuery.d.ts.map +0 -1
  230. package/dist/model/consequenceQueryObject.d.ts +0 -12
  231. package/dist/model/consequenceQueryObject.d.ts.map +0 -1
  232. package/dist/model/edit.d.ts +0 -13
  233. package/dist/model/edit.d.ts.map +0 -1
  234. package/dist/model/editType.d.ts +0 -5
  235. package/dist/model/editType.d.ts.map +0 -1
  236. package/dist/model/params.d.ts +0 -13
  237. package/dist/model/params.d.ts.map +0 -1
  238. package/dist/model/promote.d.ts +0 -4
  239. package/dist/model/promote.d.ts.map +0 -1
  240. package/dist/model/promoteObjectID.d.ts +0 -14
  241. package/dist/model/promoteObjectID.d.ts.map +0 -1
  242. package/dist/model/promoteObjectIDs.d.ts +0 -14
  243. package/dist/model/promoteObjectIDs.d.ts.map +0 -1
  244. package/dist/model/recommendationModels.d.ts +0 -5
  245. package/dist/model/recommendationModels.d.ts.map +0 -1
  246. package/dist/model/recommendationsQuery.d.ts +0 -4
  247. package/dist/model/recommendationsQuery.d.ts.map +0 -1
  248. package/dist/model/recommendedForYouQueryParameters.d.ts +0 -4
  249. package/dist/model/recommendedForYouQueryParameters.d.ts.map +0 -1
  250. package/dist/model/ruleResponse.d.ts +0 -27
  251. package/dist/model/ruleResponse.d.ts.map +0 -1
  252. package/dist/model/ruleResponseMetadata.d.ts +0 -7
  253. package/dist/model/ruleResponseMetadata.d.ts.map +0 -1
  254. package/model/anchoring.ts +0 -6
  255. package/model/automaticFacetFilter.ts +0 -21
  256. package/model/automaticFacetFilters.ts +0 -8
  257. package/model/baseRecommendationsQuery.ts +0 -17
  258. package/model/baseRecommendedForYouQueryParameters.ts +0 -8
  259. package/model/baseTrendingItemsQuery.ts +0 -22
  260. package/model/consequenceParams.ts +0 -9
  261. package/model/consequenceQuery.ts +0 -8
  262. package/model/consequenceQueryObject.ts +0 -15
  263. package/model/edit.ts +0 -17
  264. package/model/params.ts +0 -18
  265. package/model/promote.ts +0 -6
  266. package/model/promoteObjectID.ts +0 -16
  267. package/model/promoteObjectIDs.ts +0 -16
  268. package/model/recommendedForYouQueryParameters.ts +0 -7
@@ -2,7 +2,7 @@ import { createAuth, createTransporter, getAlgoliaAgent, shuffle, DEFAULT_CONNEC
2
2
  import { createHttpRequester } from '@algolia/requester-node-http';
3
3
 
4
4
  // 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.
5
- const apiClientVersion = '5.0.0-alpha.98';
5
+ const apiClientVersion = '5.0.0-beta.1';
6
6
  function getDefaultHosts(appId) {
7
7
  return [
8
8
  {
@@ -87,7 +87,6 @@ function createRecommendClient({ appId: appIdOption, apiKey: apiKeyOption, authM
87
87
  /**
88
88
  * This method allow you to send requests to the Algolia REST API.
89
89
  *
90
- * @summary Send requests to the Algolia REST API.
91
90
  * @param customDelete - The customDelete object.
92
91
  * @param customDelete.path - Path of the endpoint, anything after \"/1\" must be specified.
93
92
  * @param customDelete.parameters - Query parameters to apply to the current query.
@@ -97,7 +96,7 @@ function createRecommendClient({ appId: appIdOption, apiKey: apiKeyOption, authM
97
96
  if (!path) {
98
97
  throw new Error('Parameter `path` is required when calling `customDelete`.');
99
98
  }
100
- const requestPath = '/1{path}'.replace('{path}', path);
99
+ const requestPath = '/{path}'.replace('{path}', path);
101
100
  const headers = {};
102
101
  const queryParameters = parameters ? parameters : {};
103
102
  const request = {
@@ -111,7 +110,6 @@ function createRecommendClient({ appId: appIdOption, apiKey: apiKeyOption, authM
111
110
  /**
112
111
  * This method allow you to send requests to the Algolia REST API.
113
112
  *
114
- * @summary Send requests to the Algolia REST API.
115
113
  * @param customGet - The customGet object.
116
114
  * @param customGet.path - Path of the endpoint, anything after \"/1\" must be specified.
117
115
  * @param customGet.parameters - Query parameters to apply to the current query.
@@ -121,7 +119,7 @@ function createRecommendClient({ appId: appIdOption, apiKey: apiKeyOption, authM
121
119
  if (!path) {
122
120
  throw new Error('Parameter `path` is required when calling `customGet`.');
123
121
  }
124
- const requestPath = '/1{path}'.replace('{path}', path);
122
+ const requestPath = '/{path}'.replace('{path}', path);
125
123
  const headers = {};
126
124
  const queryParameters = parameters ? parameters : {};
127
125
  const request = {
@@ -135,7 +133,6 @@ function createRecommendClient({ appId: appIdOption, apiKey: apiKeyOption, authM
135
133
  /**
136
134
  * This method allow you to send requests to the Algolia REST API.
137
135
  *
138
- * @summary Send requests to the Algolia REST API.
139
136
  * @param customPost - The customPost object.
140
137
  * @param customPost.path - Path of the endpoint, anything after \"/1\" must be specified.
141
138
  * @param customPost.parameters - Query parameters to apply to the current query.
@@ -146,7 +143,7 @@ function createRecommendClient({ appId: appIdOption, apiKey: apiKeyOption, authM
146
143
  if (!path) {
147
144
  throw new Error('Parameter `path` is required when calling `customPost`.');
148
145
  }
149
- const requestPath = '/1{path}'.replace('{path}', path);
146
+ const requestPath = '/{path}'.replace('{path}', path);
150
147
  const headers = {};
151
148
  const queryParameters = parameters ? parameters : {};
152
149
  const request = {
@@ -161,7 +158,6 @@ function createRecommendClient({ appId: appIdOption, apiKey: apiKeyOption, authM
161
158
  /**
162
159
  * This method allow you to send requests to the Algolia REST API.
163
160
  *
164
- * @summary Send requests to the Algolia REST API.
165
161
  * @param customPut - The customPut object.
166
162
  * @param customPut.path - Path of the endpoint, anything after \"/1\" must be specified.
167
163
  * @param customPut.parameters - Query parameters to apply to the current query.
@@ -172,7 +168,7 @@ function createRecommendClient({ appId: appIdOption, apiKey: apiKeyOption, authM
172
168
  if (!path) {
173
169
  throw new Error('Parameter `path` is required when calling `customPut`.');
174
170
  }
175
- const requestPath = '/1{path}'.replace('{path}', path);
171
+ const requestPath = '/{path}'.replace('{path}', path);
176
172
  const headers = {};
177
173
  const queryParameters = parameters ? parameters : {};
178
174
  const request = {
@@ -185,13 +181,15 @@ function createRecommendClient({ appId: appIdOption, apiKey: apiKeyOption, authM
185
181
  return transporter.request(request, requestOptions);
186
182
  },
187
183
  /**
188
- * Delete a [Recommend rule](https://www.algolia.com/doc/guides/algolia-recommend/how-to/rules/).
184
+ * Deletes a Recommend rule from a recommendation scenario.
185
+ *
186
+ * Required API Key ACLs:
187
+ * - editSettings.
189
188
  *
190
- * @summary Delete a Recommend rule.
191
189
  * @param deleteRecommendRule - The deleteRecommendRule object.
192
- * @param deleteRecommendRule.indexName - Index on which to perform the request.
193
- * @param deleteRecommendRule.model - [Recommend models](https://www.algolia.com/doc/guides/algolia-recommend/overview/#recommend-models).
194
- * @param deleteRecommendRule.objectID - Unique record (object) identifier.
190
+ * @param deleteRecommendRule.indexName - Name of the index on which to perform the operation.
191
+ * @param deleteRecommendRule.model - [Recommend model](https://www.algolia.com/doc/guides/algolia-recommend/overview/#recommend-models).
192
+ * @param deleteRecommendRule.objectID - Unique record identifier.
195
193
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
196
194
  */
197
195
  deleteRecommendRule({ indexName, model, objectID }, requestOptions) {
@@ -219,13 +217,15 @@ function createRecommendClient({ appId: appIdOption, apiKey: apiKeyOption, authM
219
217
  return transporter.request(request, requestOptions);
220
218
  },
221
219
  /**
222
- * Return a [Recommend rule](https://www.algolia.com/doc/guides/algolia-recommend/how-to/rules/).
220
+ * Retrieves a Recommend rule that you previously created in the Algolia dashboard.
221
+ *
222
+ * Required API Key ACLs:
223
+ * - settings.
223
224
  *
224
- * @summary Get a Recommend rule.
225
225
  * @param getRecommendRule - The getRecommendRule object.
226
- * @param getRecommendRule.indexName - Index on which to perform the request.
227
- * @param getRecommendRule.model - [Recommend models](https://www.algolia.com/doc/guides/algolia-recommend/overview/#recommend-models).
228
- * @param getRecommendRule.objectID - Unique record (object) identifier.
226
+ * @param getRecommendRule.indexName - Name of the index on which to perform the operation.
227
+ * @param getRecommendRule.model - [Recommend model](https://www.algolia.com/doc/guides/algolia-recommend/overview/#recommend-models).
228
+ * @param getRecommendRule.objectID - Unique record identifier.
229
229
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
230
230
  */
231
231
  getRecommendRule({ indexName, model, objectID }, requestOptions) {
@@ -253,13 +253,15 @@ function createRecommendClient({ appId: appIdOption, apiKey: apiKeyOption, authM
253
253
  return transporter.request(request, requestOptions);
254
254
  },
255
255
  /**
256
- * 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.
256
+ * 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.
257
+ *
258
+ * Required API Key ACLs:
259
+ * - editSettings.
257
260
  *
258
- * @summary Get a Recommend task\'s status.
259
261
  * @param getRecommendStatus - The getRecommendStatus object.
260
- * @param getRecommendStatus.indexName - Index on which to perform the request.
261
- * @param getRecommendStatus.model - [Recommend models](https://www.algolia.com/doc/guides/algolia-recommend/overview/#recommend-models).
262
- * @param getRecommendStatus.taskID - Unique identifier of a task. Numeric value (up to 64bits).
262
+ * @param getRecommendStatus.indexName - Name of the index on which to perform the operation.
263
+ * @param getRecommendStatus.model - [Recommend model](https://www.algolia.com/doc/guides/algolia-recommend/overview/#recommend-models).
264
+ * @param getRecommendStatus.taskID - Unique task identifier.
263
265
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
264
266
  */
265
267
  getRecommendStatus({ indexName, model, taskID }, requestOptions) {
@@ -287,9 +289,11 @@ function createRecommendClient({ appId: appIdOption, apiKey: apiKeyOption, authM
287
289
  return transporter.request(request, requestOptions);
288
290
  },
289
291
  /**
290
- * 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).
292
+ * Retrieves recommendations from selected AI models.
293
+ *
294
+ * Required API Key ACLs:
295
+ * - search.
291
296
  *
292
- * @summary Get recommendations and trending items.
293
297
  * @param getRecommendationsParams - The getRecommendationsParams object.
294
298
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
295
299
  */
@@ -315,12 +319,14 @@ function createRecommendClient({ appId: appIdOption, apiKey: apiKeyOption, authM
315
319
  return transporter.request(request, requestOptions);
316
320
  },
317
321
  /**
318
- * List [Recommend rules](https://www.algolia.com/doc/guides/algolia-recommend/how-to/rules/).
322
+ * Searches for Recommend rules. Use an empty query to list all rules for this recommendation scenario.
323
+ *
324
+ * Required API Key ACLs:
325
+ * - settings.
319
326
  *
320
- * @summary List Recommend rules.
321
327
  * @param searchRecommendRules - The searchRecommendRules object.
322
- * @param searchRecommendRules.indexName - Index on which to perform the request.
323
- * @param searchRecommendRules.model - [Recommend models](https://www.algolia.com/doc/guides/algolia-recommend/overview/#recommend-models).
328
+ * @param searchRecommendRules.indexName - Name of the index on which to perform the operation.
329
+ * @param searchRecommendRules.model - [Recommend model](https://www.algolia.com/doc/guides/algolia-recommend/overview/#recommend-models).
324
330
  * @param searchRecommendRules.searchRecommendRulesParams - The searchRecommendRulesParams object.
325
331
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
326
332
  */
@@ -351,6 +357,7 @@ function createRecommendClient({ appId: appIdOption, apiKey: apiKeyOption, authM
351
357
  }
352
358
 
353
359
  // 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.
360
+ // eslint-disable-next-line @typescript-eslint/explicit-function-return-type
354
361
  function recommendClient(appId, apiKey, options) {
355
362
  if (!appId || typeof appId !== 'string') {
356
363
  throw new Error('`appId` is missing.');
@@ -358,21 +365,23 @@ function recommendClient(appId, apiKey, options) {
358
365
  if (!apiKey || typeof apiKey !== 'string') {
359
366
  throw new Error('`apiKey` is missing.');
360
367
  }
361
- return createRecommendClient({
362
- appId,
363
- apiKey,
364
- timeouts: {
365
- connect: DEFAULT_CONNECT_TIMEOUT_NODE,
366
- read: DEFAULT_READ_TIMEOUT_NODE,
367
- write: DEFAULT_WRITE_TIMEOUT_NODE,
368
- },
369
- requester: createHttpRequester(),
370
- algoliaAgents: [{ segment: 'Node.js', version: process.versions.node }],
371
- responsesCache: createNullCache(),
372
- requestsCache: createNullCache(),
373
- hostsCache: createMemoryCache(),
374
- ...options,
375
- });
368
+ return {
369
+ ...createRecommendClient({
370
+ appId,
371
+ apiKey,
372
+ timeouts: {
373
+ connect: DEFAULT_CONNECT_TIMEOUT_NODE,
374
+ read: DEFAULT_READ_TIMEOUT_NODE,
375
+ write: DEFAULT_WRITE_TIMEOUT_NODE,
376
+ },
377
+ requester: createHttpRequester(),
378
+ algoliaAgents: [{ segment: 'Node.js', version: process.versions.node }],
379
+ responsesCache: createNullCache(),
380
+ requestsCache: createNullCache(),
381
+ hostsCache: createMemoryCache(),
382
+ ...options,
383
+ }),
384
+ };
376
385
  }
377
386
 
378
387
  export { apiClientVersion, recommendClient };
@@ -1,2 +1,2 @@
1
- /*! recommend.umd.js | 5.0.0-alpha.98 | © 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 s(){return JSON.parse(a().getItem(r)||"{}")}function o(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=s(),a=Object.fromEntries(Object.entries(r).filter((([,e])=>void 0!==e.timestamp)));if(o(a),!t)return;o(Object.fromEntries(Object.entries(a).filter((([,e])=>{const r=(new Date).getTime();return!(e.timestamp+t<r)}))))}(),s()[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 o=s();return o[JSON.stringify(e)]={timestamp:(new Date).getTime(),value:t},a().setItem(r,JSON.stringify(o)),t})),delete:e=>Promise.resolve().then((()=>{const t=s();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,s,o={miss:()=>Promise.resolve()})=>a.get(e,s,o).catch((()=>r({caches:t}).get(e,s,o))),set:(e,s)=>a.set(e,s).catch((()=>r({caches:t}).set(e,s))),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,s={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=a();return n.then((e=>s.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 s=12e4;function o(e,t="up"){const r=Date.now();return{...e,status:t,lastUpdate:r,isUp:function(){return"up"===t||Date.now()-r>s},isTimedOut:function(){return"timed out"===t&&Date.now()-r<=s}}}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:String(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 u extends c{constructor(e,t,r){super(e,r),i(this,"stackTrace",void 0),this.stackTrace=t}}class l extends u{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 u{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])}`)).join("&")}(r);let s=`${e.protocol}://${e.url}/${"/"===t.charAt(0)?t.substr(1):t}`;return a.length&&(s+=`?${a}`),s}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:s,timeouts:n,requester:i,requestsCache:c,responsesCache:u}){async function f(c,u,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,u),P=function(e,t,r){const a={Accept:"application/json",...e,...t,...r},s={};return Object.keys(a).forEach((e=>{const t=a[e];s[e.toLowerCase()]=t})),s}(r,c.headers,u.headers),q="GET"===c.method?{...c.data,...u.data}:{},b={...a,...c.queryParameters,...q};if(s.value&&(b["x-algolia-agent"]=s.value),u&&u.queryParameters)for(const e of Object.keys(u.queryParameters))u.queryParameters[e]&&"[object Object]"!==Object.prototype.toString.call(u.queryParameters[e])?b[e]=u.queryParameters[e].toString():b[e]=u.queryParameters[e];let v=0;const R=async(e,r)=>{const a=e.pop();if(void 0===a)throw new l(function(e){return e.map((e=>g(e)))}(w));let s=u.timeout;void 0===s&&(s=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,s)},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&&0==~~t}({isTimedOut:e,status:t})||2!=~~(t/100)&&4!=~~(t/100)}(O)){const s=T(O);return O.isTimedOut&&v++,console.log("Retryable failure",g(s)),await t.set(a,o(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(o(e))))))),a=r.filter((e=>e.isUp())),s=r.filter((e=>e.isTimedOut())),n=[...a,...s];return{hosts:n.length>0?n:e,getTimeout:(e,t)=>(0===s.length&&0===e?1:s.length+3+e)*t}}(T);return R([...O.hosts].reverse(),O.getTimeout)}return{hostsCache:t,requester:i,timeouts:n,algoliaAgent:s,baseHeaders:r,baseQueryParameters:a,hosts:e,request:function(e,t={}){const s=e.useReadTransporter||"GET"===e.method;if(!s)return f(e,t,s);const o=()=>f(e,t);if(!0!==(t.cacheable||e.cacheable))return o();const n={request:e,requestOptions:t,transporter:{queryParameters:a,headers:r}};return u.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=>u.set(n,e)})},requestsCache:c,responsesCache:u}}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.98";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)),s=e[r];t[r]=e[a],t[a]=s}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,s,o){if(!e||"string"!=typeof e)throw new Error("`appId` is missing.");if(!s||"string"!=typeof s)throw new Error("`apiKey` is missing.");return function({appId:e,apiKey:t,authMode:r,algoliaAgents:a,...s}){const o=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),...s,algoliaAgent:w({algoliaAgents:a,client:"Recommend",version:y}),baseHeaders:{"content-type":"text/plain",...o.headers(),...s.baseHeaders},baseQueryParameters:{...o.queryParameters(),...s.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:"/1{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:"/1{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 s={method:"POST",path:"/1{path}".replace("{path}",e),queryParameters:t||{},headers:{},data:r||{}};return n.request(s,a)},customPut({path:e,parameters:t,body:r},a){if(!e)throw new Error("Parameter `path` is required when calling `customPut`.");const s={method:"PUT",path:"/1{path}".replace("{path}",e),queryParameters:t||{},headers:{},data:r||{}};return n.request(s,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 s={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(s,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 s={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(s,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 s={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(s,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 s={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(s,a)}}}({appId:e,apiKey:s,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),s=a(e.connectTimeout,"Connection timeout");let o;r.onreadystatechange=()=>{r.readyState>r.OPENED&&void 0===o&&(clearTimeout(s),o=a(e.responseTimeout,"Socket timeout"))},r.onerror=()=>{0===r.status&&(clearTimeout(s),clearTimeout(o),t({content:r.responseText||"Network request failed",status:r.status,isTimedOut:!1}))},r.onload=()=>{clearTimeout(s),clearTimeout(o),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()]}),...o})}}));
1
+ /*! recommend.umd.js | 5.0.0-beta.1 | © 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 s(){return JSON.parse(a().getItem(r)||"{}")}function o(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=s(),a=Object.fromEntries(Object.entries(r).filter((([,e])=>void 0!==e.timestamp)));if(o(a),!t)return;o(Object.fromEntries(Object.entries(a).filter((([,e])=>{const r=(new Date).getTime();return!(e.timestamp+t<r)}))))}(),s()[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 o=s();return o[JSON.stringify(e)]={timestamp:(new Date).getTime(),value:t},a().setItem(r,JSON.stringify(o)),t})),delete:e=>Promise.resolve().then((()=>{const t=s();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,s,o={miss:()=>Promise.resolve()})=>a.get(e,s,o).catch((()=>r({caches:t}).get(e,s,o))),set:(e,s)=>a.set(e,s).catch((()=>r({caches:t}).set(e,s))),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,s={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=a();return n.then((e=>s.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 s=12e4;function o(e,t="up"){const r=Date.now();return{...e,status:t,lastUpdate:r,isUp:function(){return"up"===t||Date.now()-r>s},isTimedOut:function(){return"timed out"===t&&Date.now()-r<=s}}}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 u extends c{constructor(e,t,r){super(e,r),i(this,"stackTrace",void 0),this.stackTrace=t}}class l extends u{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 u{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 s=`${e.protocol}://${e.url}${e.port?`:${e.port}`:""}/${"/"===t.charAt(0)?t.substring(1):t}`;return a.length&&(s+=`?${a}`),s}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:s,timeouts:n,requester:i,requestsCache:c,responsesCache:u}){async function f(c,u,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,u),P=function(e,t,r){const a={Accept:"application/json",...e,...t,...r},s={};return Object.keys(a).forEach((e=>{const t=a[e];s[e.toLowerCase()]=t})),s}(r,c.headers,u.headers),q="GET"===c.method?{...c.data,...u.data}:{},b={...a,...c.queryParameters,...q};if(s.value&&(b["x-algolia-agent"]=s.value),u&&u.queryParameters)for(const e of Object.keys(u.queryParameters))u.queryParameters[e]&&"[object Object]"!==Object.prototype.toString.call(u.queryParameters[e])?b[e]=u.queryParameters[e].toString():b[e]=u.queryParameters[e];let v=0;const R=async(e,r)=>{const a=e.pop();if(void 0===a)throw new l(function(e){return e.map((e=>g(e)))}(w));let s=f?u.timeouts?.read||n.read:u.timeouts?.write||n.write;const q={data:y,headers:P,method:c.method,url:p(a,c.path,b),connectTimeout:r(v,u.timeouts?.connect||n.connect),responseTimeout:r(v,s)},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 s=T(O);return O.isTimedOut&&v++,console.log("Retryable failure",g(s)),await t.set(a,o(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(o(e))))))),a=r.filter((e=>e.isUp())),s=r.filter((e=>e.isTimedOut())),n=[...a,...s];return{hosts:n.length>0?n:e,getTimeout:(e,t)=>(0===s.length&&0===e?1:s.length+3+e)*t}}(T);return R([...O.hosts].reverse(),O.getTimeout)}return{hostsCache:t,requester:i,timeouts:n,algoliaAgent:s,baseHeaders:r,baseQueryParameters:a,hosts:e,request:function(e,t={}){const s=e.useReadTransporter||"GET"===e.method;if(!s)return f(e,t,s);const o=()=>f(e,t);if(!0!==(t.cacheable||e.cacheable))return o();const n={request:e,requestOptions:t,transporter:{queryParameters:a,headers:r}};return u.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=>u.set(n,e)})},requestsCache:c,responsesCache:u}}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-beta.1";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)),s=e[r];t[r]=e[a],t[a]=s}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,s,o){if(!e||"string"!=typeof e)throw new Error("`appId` is missing.");if(!s||"string"!=typeof s)throw new Error("`apiKey` is missing.");return function({appId:e,apiKey:t,authMode:r,algoliaAgents:a,...s}){const o=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),...s,algoliaAgent:w({algoliaAgents:a,client:"Recommend",version:y}),baseHeaders:{"content-type":"text/plain",...o.headers(),...s.baseHeaders},baseQueryParameters:{...o.queryParameters(),...s.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 s={method:"POST",path:"/{path}".replace("{path}",e),queryParameters:t||{},headers:{},data:r||{}};return n.request(s,a)},customPut({path:e,parameters:t,body:r},a){if(!e)throw new Error("Parameter `path` is required when calling `customPut`.");const s={method:"PUT",path:"/{path}".replace("{path}",e),queryParameters:t||{},headers:{},data:r||{}};return n.request(s,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 s={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(s,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 s={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(s,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 s={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(s,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 s={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(s,a)}}}({appId:e,apiKey:s,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),s=a(e.connectTimeout,"Connection timeout");let o;r.onreadystatechange=()=>{r.readyState>r.OPENED&&void 0===o&&(clearTimeout(s),o=a(e.responseTimeout,"Socket timeout"))},r.onerror=()=>{0===r.status&&(clearTimeout(s),clearTimeout(o),t({content:r.responseText||"Network request failed",status:r.status,isTimedOut:!1}))},r.onload=()=>{clearTimeout(s),clearTimeout(o),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()]}),...o})}}));
@@ -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.98";
9
+ export declare const apiClientVersion = "5.0.0-beta.1";
10
10
  export declare function createRecommendClient({ appId: appIdOption, apiKey: apiKeyOption, authMode, algoliaAgents, ...options }: CreateClientOptions): {
11
11
  transporter: import("@algolia/client-common").Transporter;
12
12
  /**
@@ -31,7 +31,6 @@ export declare function createRecommendClient({ appId: appIdOption, apiKey: apiK
31
31
  /**
32
32
  * This method allow you to send requests to the Algolia REST API.
33
33
  *
34
- * @summary Send requests to the Algolia REST API.
35
34
  * @param customDelete - The customDelete object.
36
35
  * @param customDelete.path - Path of the endpoint, anything after \"/1\" must be specified.
37
36
  * @param customDelete.parameters - Query parameters to apply to the current query.
@@ -41,7 +40,6 @@ export declare function createRecommendClient({ appId: appIdOption, apiKey: apiK
41
40
  /**
42
41
  * This method allow you to send requests to the Algolia REST API.
43
42
  *
44
- * @summary Send requests to the Algolia REST API.
45
43
  * @param customGet - The customGet object.
46
44
  * @param customGet.path - Path of the endpoint, anything after \"/1\" must be specified.
47
45
  * @param customGet.parameters - Query parameters to apply to the current query.
@@ -51,7 +49,6 @@ export declare function createRecommendClient({ appId: appIdOption, apiKey: apiK
51
49
  /**
52
50
  * This method allow you to send requests to the Algolia REST API.
53
51
  *
54
- * @summary Send requests to the Algolia REST API.
55
52
  * @param customPost - The customPost object.
56
53
  * @param customPost.path - Path of the endpoint, anything after \"/1\" must be specified.
57
54
  * @param customPost.parameters - Query parameters to apply to the current query.
@@ -62,7 +59,6 @@ export declare function createRecommendClient({ appId: appIdOption, apiKey: apiK
62
59
  /**
63
60
  * This method allow you to send requests to the Algolia REST API.
64
61
  *
65
- * @summary Send requests to the Algolia REST API.
66
62
  * @param customPut - The customPut object.
67
63
  * @param customPut.path - Path of the endpoint, anything after \"/1\" must be specified.
68
64
  * @param customPut.parameters - Query parameters to apply to the current query.
@@ -71,60 +67,66 @@ export declare function createRecommendClient({ appId: appIdOption, apiKey: apiK
71
67
  */
72
68
  customPut({ path, parameters, body }: CustomPutProps, requestOptions?: RequestOptions): Promise<Record<string, any>>;
73
69
  /**
74
- * 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
+ *
72
+ * Required API Key ACLs:
73
+ * - editSettings.
75
74
  *
76
- * @summary Delete a Recommend rule.
77
75
  * @param deleteRecommendRule - The deleteRecommendRule object.
78
- * @param deleteRecommendRule.indexName - Index on which to perform the request.
79
- * @param deleteRecommendRule.model - [Recommend models](https://www.algolia.com/doc/guides/algolia-recommend/overview/#recommend-models).
80
- * @param deleteRecommendRule.objectID - Unique record (object) identifier.
76
+ * @param deleteRecommendRule.indexName - Name of the index on which to perform the operation.
77
+ * @param deleteRecommendRule.model - [Recommend model](https://www.algolia.com/doc/guides/algolia-recommend/overview/#recommend-models).
78
+ * @param deleteRecommendRule.objectID - Unique record identifier.
81
79
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
82
80
  */
83
81
  deleteRecommendRule({ indexName, model, objectID }: DeleteRecommendRuleProps, requestOptions?: RequestOptions): Promise<DeletedAtResponse>;
84
82
  /**
85
- * 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
+ *
85
+ * Required API Key ACLs:
86
+ * - settings.
86
87
  *
87
- * @summary Get a Recommend rule.
88
88
  * @param getRecommendRule - The getRecommendRule object.
89
- * @param getRecommendRule.indexName - Index on which to perform the request.
90
- * @param getRecommendRule.model - [Recommend models](https://www.algolia.com/doc/guides/algolia-recommend/overview/#recommend-models).
91
- * @param getRecommendRule.objectID - Unique record (object) identifier.
89
+ * @param getRecommendRule.indexName - Name of the index on which to perform the operation.
90
+ * @param getRecommendRule.model - [Recommend model](https://www.algolia.com/doc/guides/algolia-recommend/overview/#recommend-models).
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
+ *
98
+ * Required API Key ACLs:
99
+ * - editSettings.
97
100
  *
98
- * @summary Get a Recommend task\'s status.
99
101
  * @param getRecommendStatus - The getRecommendStatus object.
100
- * @param getRecommendStatus.indexName - Index on which to perform the request.
101
- * @param getRecommendStatus.model - [Recommend models](https://www.algolia.com/doc/guides/algolia-recommend/overview/#recommend-models).
102
- * @param getRecommendStatus.taskID - Unique identifier of a task. Numeric value (up to 64bits).
102
+ * @param getRecommendStatus.indexName - Name of the index on which to perform the operation.
103
+ * @param getRecommendStatus.model - [Recommend model](https://www.algolia.com/doc/guides/algolia-recommend/overview/#recommend-models).
104
+ * @param getRecommendStatus.taskID - Unique task identifier.
103
105
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
104
106
  */
105
107
  getRecommendStatus({ indexName, model, taskID }: GetRecommendStatusProps, requestOptions?: RequestOptions): Promise<GetRecommendTaskResponse>;
106
108
  /**
107
- * 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
+ *
111
+ * Required API Key ACLs:
112
+ * - search.
108
113
  *
109
- * @summary Get recommendations and trending items.
110
114
  * @param getRecommendationsParams - The getRecommendationsParams object.
111
115
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
112
116
  */
113
117
  getRecommendations(getRecommendationsParams: GetRecommendationsParams, requestOptions?: RequestOptions): Promise<GetRecommendationsResponse>;
114
118
  /**
115
- * 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
+ *
121
+ * Required API Key ACLs:
122
+ * - settings.
116
123
  *
117
- * @summary List Recommend rules.
118
124
  * @param searchRecommendRules - The searchRecommendRules object.
119
- * @param searchRecommendRules.indexName - Index on which to perform the request.
120
- * @param searchRecommendRules.model - [Recommend models](https://www.algolia.com/doc/guides/algolia-recommend/overview/#recommend-models).
125
+ * @param searchRecommendRules.indexName - Name of the index on which to perform the operation.
126
+ * @param searchRecommendRules.model - [Recommend model](https://www.algolia.com/doc/guides/algolia-recommend/overview/#recommend-models).
121
127
  * @param searchRecommendRules.searchRecommendRulesParams - The searchRecommendRulesParams object.
122
128
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
123
129
  */
124
130
  searchRecommendRules({ indexName, model, searchRecommendRulesParams, }: SearchRecommendRulesProps, requestOptions?: RequestOptions): Promise<SearchRecommendRulesResponse>;
125
131
  };
126
- /**
127
- * The client type.
128
- */
129
- export type RecommendClient = ReturnType<typeof createRecommendClient>;
130
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,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,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;uCAEqB,iBAAiB,mBACtB,cAAc,GAC9B,QAAQ,OAAO,MAAM,EAAE,GAAG,CAAC,CAAC;IAqB/B;;;;;;;;OAQG;oCAEqB,cAAc,mBACnB,cAAc,GAC9B,QAAQ,OAAO,MAAM,EAAE,GAAG,CAAC,CAAC;IAqB/B;;;;;;;;;OASG;2CAE2B,eAAe,mBAC1B,cAAc,GAC9B,QAAQ,OAAO,MAAM,EAAE,GAAG,CAAC,CAAC;IAsB/B;;;;;;;;;OASG;0CAE2B,cAAc,mBACzB,cAAc,GAC9B,QAAQ,OAAO,MAAM,EAAE,GAAG,CAAC,CAAC;IAsB/B;;;;;;;;;OASG;wDAE+B,wBAAwB,mBACvC,cAAc,GAC9B,QAAQ,iBAAiB,CAAC;IAqC7B;;;;;;;;;OASG;qDAE+B,qBAAqB,mBACpC,cAAc,GAC9B,QAAQ,YAAY,CAAC;IAqCxB;;;;;;;;;OASG;qDAE6B,uBAAuB,mBACpC,cAAc,GAC9B,QAAQ,wBAAwB,CAAC;IAoCpC;;;;;;OAMG;iDAEyB,wBAAwB,mBACjC,cAAc,GAC9B,QAAQ,0BAA0B,CAAC;IA8BtC;;;;;;;;;OASG;4EAME,yBAAyB,mBACX,cAAc,GAC9B,QAAQ,4BAA4B,CAAC;EAiC3C;AAED;;GAEG;AACH,MAAM,MAAM,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,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAC5D,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,uCAAuC,CAAC;AAE1F,eAAO,MAAM,gBAAgB,iBAAiB,CAAC;AAsC/C,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"}
@@ -3,6 +3,6 @@
3
3
  import type { AroundPrecisionFromValueInner } from './aroundPrecisionFromValueInner';
4
4
 
5
5
  /**
6
- * Precision of a geographical search (in meters), to [group results that are more or less the same distance from a central point](https://www.algolia.com/doc/guides/managing-results/refine-results/geolocation/in-depth/geo-ranking-precision/).
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
7
  */
8
8
  export type AroundPrecision = AroundPrecisionFromValueInner[] | number;
@@ -1,7 +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
+ /**
4
+ * Range object with lower and upper values in meters to define custom ranges.
5
+ */
3
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
+ */
4
10
  from?: number;
5
11
 
12
+ /**
13
+ * Upper boundary of a range in meters. The Geo ranking criterion considers all records within the range to be equal.
14
+ */
6
15
  value?: number;
7
16
  };
@@ -3,6 +3,6 @@
3
3
  import type { AroundRadiusAll } from './aroundRadiusAll';
4
4
 
5
5
  /**
6
- * [Maximum radius](https://www.algolia.com/doc/guides/managing-results/refine-results/geolocation/#increase-the-search-radius) for a geographical 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
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,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,18 +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 { SearchParams } from './searchParams';
4
+
3
5
  export type BaseRecommendRequest = {
4
6
  /**
5
- * Algolia index name.
7
+ * Index name (case-sensitive).
6
8
  */
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
  };