@algolia/recommend 5.2.4 → 5.3.0

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 (219) hide show
  1. package/dist/browser.d.ts +1414 -0
  2. package/dist/builds/browser.js +408 -0
  3. package/dist/builds/browser.js.map +1 -0
  4. package/dist/builds/browser.min.js +2 -0
  5. package/dist/builds/browser.min.js.map +1 -0
  6. package/dist/builds/browser.umd.js +12 -0
  7. package/dist/builds/node.cjs +426 -0
  8. package/dist/builds/node.cjs.map +1 -0
  9. package/dist/builds/node.js +406 -0
  10. package/dist/builds/node.js.map +1 -0
  11. package/dist/node.d.cts +1414 -0
  12. package/dist/node.d.ts +1414 -0
  13. package/dist/src/recommendClient.cjs +395 -0
  14. package/dist/src/recommendClient.cjs.map +1 -0
  15. package/dist/src/recommendClient.js +369 -0
  16. package/dist/src/recommendClient.js.map +1 -0
  17. package/index.d.ts +1 -1
  18. package/index.js +1 -1
  19. package/package.json +28 -25
  20. package/dist/builds/browser.d.ts +0 -24
  21. package/dist/builds/browser.d.ts.map +0 -1
  22. package/dist/builds/node.d.ts +0 -24
  23. package/dist/builds/node.d.ts.map +0 -1
  24. package/dist/model/advancedSyntaxFeatures.d.ts +0 -2
  25. package/dist/model/advancedSyntaxFeatures.d.ts.map +0 -1
  26. package/dist/model/alternativesAsExact.d.ts +0 -2
  27. package/dist/model/alternativesAsExact.d.ts.map +0 -1
  28. package/dist/model/aroundPrecision.d.ts +0 -6
  29. package/dist/model/aroundPrecision.d.ts.map +0 -1
  30. package/dist/model/aroundRadius.d.ts +0 -6
  31. package/dist/model/aroundRadius.d.ts.map +0 -1
  32. package/dist/model/aroundRadiusAll.d.ts +0 -5
  33. package/dist/model/aroundRadiusAll.d.ts.map +0 -1
  34. package/dist/model/autoFacetFilter.d.ts +0 -14
  35. package/dist/model/autoFacetFilter.d.ts.map +0 -1
  36. package/dist/model/baseRecommendRequest.d.ts +0 -17
  37. package/dist/model/baseRecommendRequest.d.ts.map +0 -1
  38. package/dist/model/baseSearchParams.d.ts +0 -4
  39. package/dist/model/baseSearchParams.d.ts.map +0 -1
  40. package/dist/model/baseSearchParamsWithoutQuery.d.ts +0 -116
  41. package/dist/model/baseSearchParamsWithoutQuery.d.ts.map +0 -1
  42. package/dist/model/baseSearchResponse.d.ts +0 -94
  43. package/dist/model/baseSearchResponse.d.ts.map +0 -1
  44. package/dist/model/booleanString.d.ts +0 -2
  45. package/dist/model/booleanString.d.ts.map +0 -1
  46. package/dist/model/boughtTogetherQuery.d.ts +0 -4
  47. package/dist/model/boughtTogetherQuery.d.ts.map +0 -1
  48. package/dist/model/clientMethodProps.d.ts +0 -135
  49. package/dist/model/clientMethodProps.d.ts.map +0 -1
  50. package/dist/model/condition.d.ts +0 -14
  51. package/dist/model/condition.d.ts.map +0 -1
  52. package/dist/model/consequence.d.ts +0 -18
  53. package/dist/model/consequence.d.ts.map +0 -1
  54. package/dist/model/deletedAtResponse.d.ts +0 -14
  55. package/dist/model/deletedAtResponse.d.ts.map +0 -1
  56. package/dist/model/distinct.d.ts +0 -5
  57. package/dist/model/distinct.d.ts.map +0 -1
  58. package/dist/model/errorBase.d.ts +0 -7
  59. package/dist/model/errorBase.d.ts.map +0 -1
  60. package/dist/model/exactOnSingleWordQuery.d.ts +0 -5
  61. package/dist/model/exactOnSingleWordQuery.d.ts.map +0 -1
  62. package/dist/model/exhaustive.d.ts +0 -26
  63. package/dist/model/exhaustive.d.ts.map +0 -1
  64. package/dist/model/facetFilters.d.ts +0 -5
  65. package/dist/model/facetFilters.d.ts.map +0 -1
  66. package/dist/model/facetOrdering.d.ts +0 -13
  67. package/dist/model/facetOrdering.d.ts.map +0 -1
  68. package/dist/model/facetStats.d.ts +0 -19
  69. package/dist/model/facetStats.d.ts.map +0 -1
  70. package/dist/model/facets.d.ts +0 -10
  71. package/dist/model/facets.d.ts.map +0 -1
  72. package/dist/model/fallbackParams.d.ts +0 -3
  73. package/dist/model/fallbackParams.d.ts.map +0 -1
  74. package/dist/model/fbtModel.d.ts +0 -5
  75. package/dist/model/fbtModel.d.ts.map +0 -1
  76. package/dist/model/frequentlyBoughtTogether.d.ts +0 -9
  77. package/dist/model/frequentlyBoughtTogether.d.ts.map +0 -1
  78. package/dist/model/getRecommendTaskResponse.d.ts +0 -5
  79. package/dist/model/getRecommendTaskResponse.d.ts.map +0 -1
  80. package/dist/model/getRecommendationsParams.d.ts +0 -11
  81. package/dist/model/getRecommendationsParams.d.ts.map +0 -1
  82. package/dist/model/getRecommendationsResponse.d.ts +0 -5
  83. package/dist/model/getRecommendationsResponse.d.ts.map +0 -1
  84. package/dist/model/hideConsequenceObject.d.ts +0 -10
  85. package/dist/model/hideConsequenceObject.d.ts.map +0 -1
  86. package/dist/model/highlightResult.d.ts +0 -5
  87. package/dist/model/highlightResult.d.ts.map +0 -1
  88. package/dist/model/highlightResultOption.d.ts +0 -20
  89. package/dist/model/highlightResultOption.d.ts.map +0 -1
  90. package/dist/model/ignorePlurals.d.ts +0 -7
  91. package/dist/model/ignorePlurals.d.ts.map +0 -1
  92. package/dist/model/index.d.ts +0 -95
  93. package/dist/model/index.d.ts.map +0 -1
  94. package/dist/model/indexSettingsAsSearchParams.d.ts +0 -160
  95. package/dist/model/indexSettingsAsSearchParams.d.ts.map +0 -1
  96. package/dist/model/lookingSimilar.d.ts +0 -11
  97. package/dist/model/lookingSimilar.d.ts.map +0 -1
  98. package/dist/model/lookingSimilarModel.d.ts +0 -5
  99. package/dist/model/lookingSimilarModel.d.ts.map +0 -1
  100. package/dist/model/lookingSimilarQuery.d.ts +0 -4
  101. package/dist/model/lookingSimilarQuery.d.ts.map +0 -1
  102. package/dist/model/matchLevel.d.ts +0 -5
  103. package/dist/model/matchLevel.d.ts.map +0 -1
  104. package/dist/model/matchedGeoLocation.d.ts +0 -15
  105. package/dist/model/matchedGeoLocation.d.ts.map +0 -1
  106. package/dist/model/mode.d.ts +0 -5
  107. package/dist/model/mode.d.ts.map +0 -1
  108. package/dist/model/numericFilters.d.ts +0 -5
  109. package/dist/model/numericFilters.d.ts.map +0 -1
  110. package/dist/model/optionalFilters.d.ts +0 -5
  111. package/dist/model/optionalFilters.d.ts.map +0 -1
  112. package/dist/model/paramsConsequence.d.ts +0 -19
  113. package/dist/model/paramsConsequence.d.ts.map +0 -1
  114. package/dist/model/personalization.d.ts +0 -15
  115. package/dist/model/personalization.d.ts.map +0 -1
  116. package/dist/model/promoteConsequenceObject.d.ts +0 -14
  117. package/dist/model/promoteConsequenceObject.d.ts.map +0 -1
  118. package/dist/model/queryType.d.ts +0 -5
  119. package/dist/model/queryType.d.ts.map +0 -1
  120. package/dist/model/range.d.ts +0 -14
  121. package/dist/model/range.d.ts.map +0 -1
  122. package/dist/model/rankingInfo.d.ts +0 -54
  123. package/dist/model/rankingInfo.d.ts.map +0 -1
  124. package/dist/model/reRankingApplyFilter.d.ts +0 -5
  125. package/dist/model/reRankingApplyFilter.d.ts.map +0 -1
  126. package/dist/model/recommendHit.d.ts +0 -27
  127. package/dist/model/recommendHit.d.ts.map +0 -1
  128. package/dist/model/recommendModels.d.ts +0 -2
  129. package/dist/model/recommendModels.d.ts.map +0 -1
  130. package/dist/model/recommendRule.d.ts +0 -24
  131. package/dist/model/recommendRule.d.ts.map +0 -1
  132. package/dist/model/recommendationsHit.d.ts +0 -4
  133. package/dist/model/recommendationsHit.d.ts.map +0 -1
  134. package/dist/model/recommendationsHits.d.ts +0 -5
  135. package/dist/model/recommendationsHits.d.ts.map +0 -1
  136. package/dist/model/recommendationsRequest.d.ts +0 -8
  137. package/dist/model/recommendationsRequest.d.ts.map +0 -1
  138. package/dist/model/recommendationsResults.d.ts +0 -5
  139. package/dist/model/recommendationsResults.d.ts.map +0 -1
  140. package/dist/model/recommendedForYou.d.ts +0 -7
  141. package/dist/model/recommendedForYou.d.ts.map +0 -1
  142. package/dist/model/recommendedForYouModel.d.ts +0 -5
  143. package/dist/model/recommendedForYouModel.d.ts.map +0 -1
  144. package/dist/model/recommendedForYouQuery.d.ts +0 -4
  145. package/dist/model/recommendedForYouQuery.d.ts.map +0 -1
  146. package/dist/model/redirect.d.ts +0 -8
  147. package/dist/model/redirect.d.ts.map +0 -1
  148. package/dist/model/redirectRuleIndexData.d.ts +0 -7
  149. package/dist/model/redirectRuleIndexData.d.ts.map +0 -1
  150. package/dist/model/redirectRuleIndexMetadata.d.ts +0 -21
  151. package/dist/model/redirectRuleIndexMetadata.d.ts.map +0 -1
  152. package/dist/model/redirectURL.d.ts +0 -7
  153. package/dist/model/redirectURL.d.ts.map +0 -1
  154. package/dist/model/relatedModel.d.ts +0 -5
  155. package/dist/model/relatedModel.d.ts.map +0 -1
  156. package/dist/model/relatedProducts.d.ts +0 -11
  157. package/dist/model/relatedProducts.d.ts.map +0 -1
  158. package/dist/model/relatedQuery.d.ts +0 -4
  159. package/dist/model/relatedQuery.d.ts.map +0 -1
  160. package/dist/model/removeStopWords.d.ts +0 -6
  161. package/dist/model/removeStopWords.d.ts.map +0 -1
  162. package/dist/model/removeWordsIfNoResults.d.ts +0 -5
  163. package/dist/model/removeWordsIfNoResults.d.ts.map +0 -1
  164. package/dist/model/renderingContent.d.ts +0 -10
  165. package/dist/model/renderingContent.d.ts.map +0 -1
  166. package/dist/model/ruleMetadata.d.ts +0 -10
  167. package/dist/model/ruleMetadata.d.ts.map +0 -1
  168. package/dist/model/searchPagination.d.ts +0 -19
  169. package/dist/model/searchPagination.d.ts.map +0 -1
  170. package/dist/model/searchParams.d.ts +0 -3
  171. package/dist/model/searchParams.d.ts.map +0 -1
  172. package/dist/model/searchParamsObject.d.ts +0 -7
  173. package/dist/model/searchParamsObject.d.ts.map +0 -1
  174. package/dist/model/searchParamsQuery.d.ts +0 -7
  175. package/dist/model/searchParamsQuery.d.ts.map +0 -1
  176. package/dist/model/searchRecommendRulesParams.d.ts +0 -38
  177. package/dist/model/searchRecommendRulesParams.d.ts.map +0 -1
  178. package/dist/model/searchRecommendRulesResponse.d.ts +0 -20
  179. package/dist/model/searchRecommendRulesResponse.d.ts.map +0 -1
  180. package/dist/model/semanticSearch.d.ts +0 -10
  181. package/dist/model/semanticSearch.d.ts.map +0 -1
  182. package/dist/model/snippetResult.d.ts +0 -5
  183. package/dist/model/snippetResult.d.ts.map +0 -1
  184. package/dist/model/snippetResultOption.d.ts +0 -12
  185. package/dist/model/snippetResultOption.d.ts.map +0 -1
  186. package/dist/model/sortRemainingBy.d.ts +0 -5
  187. package/dist/model/sortRemainingBy.d.ts.map +0 -1
  188. package/dist/model/supportedLanguage.d.ts +0 -5
  189. package/dist/model/supportedLanguage.d.ts.map +0 -1
  190. package/dist/model/tagFilters.d.ts +0 -5
  191. package/dist/model/tagFilters.d.ts.map +0 -1
  192. package/dist/model/taskStatus.d.ts +0 -5
  193. package/dist/model/taskStatus.d.ts.map +0 -1
  194. package/dist/model/trendingFacetHit.d.ts +0 -18
  195. package/dist/model/trendingFacetHit.d.ts.map +0 -1
  196. package/dist/model/trendingFacets.d.ts +0 -11
  197. package/dist/model/trendingFacets.d.ts.map +0 -1
  198. package/dist/model/trendingFacetsModel.d.ts +0 -5
  199. package/dist/model/trendingFacetsModel.d.ts.map +0 -1
  200. package/dist/model/trendingFacetsQuery.d.ts +0 -4
  201. package/dist/model/trendingFacetsQuery.d.ts.map +0 -1
  202. package/dist/model/trendingItems.d.ts +0 -15
  203. package/dist/model/trendingItems.d.ts.map +0 -1
  204. package/dist/model/trendingItemsModel.d.ts +0 -5
  205. package/dist/model/trendingItemsModel.d.ts.map +0 -1
  206. package/dist/model/trendingItemsQuery.d.ts +0 -4
  207. package/dist/model/trendingItemsQuery.d.ts.map +0 -1
  208. package/dist/model/typoTolerance.d.ts +0 -6
  209. package/dist/model/typoTolerance.d.ts.map +0 -1
  210. package/dist/model/typoToleranceEnum.d.ts +0 -5
  211. package/dist/model/typoToleranceEnum.d.ts.map +0 -1
  212. package/dist/model/value.d.ts +0 -13
  213. package/dist/model/value.d.ts.map +0 -1
  214. package/dist/recommend.cjs +0 -394
  215. package/dist/recommend.esm.browser.js +0 -1079
  216. package/dist/recommend.esm.node.js +0 -391
  217. package/dist/recommend.umd.js +0 -2
  218. package/dist/src/recommendClient.d.ts +0 -132
  219. package/dist/src/recommendClient.d.ts.map +0 -1
@@ -1,391 +0,0 @@
1
- import { createAuth, createTransporter, getAlgoliaAgent, shuffle, DEFAULT_CONNECT_TIMEOUT_NODE, DEFAULT_READ_TIMEOUT_NODE, DEFAULT_WRITE_TIMEOUT_NODE, createNullCache, createMemoryCache } from '@algolia/client-common';
2
- import { createHttpRequester } from '@algolia/requester-node-http';
3
-
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.2.4';
6
- function getDefaultHosts(appId) {
7
- return [
8
- {
9
- url: `${appId}-dsn.algolia.net`,
10
- accept: 'read',
11
- protocol: 'https',
12
- },
13
- {
14
- url: `${appId}.algolia.net`,
15
- accept: 'write',
16
- protocol: 'https',
17
- },
18
- ].concat(shuffle([
19
- {
20
- url: `${appId}-1.algolianet.com`,
21
- accept: 'readWrite',
22
- protocol: 'https',
23
- },
24
- {
25
- url: `${appId}-2.algolianet.com`,
26
- accept: 'readWrite',
27
- protocol: 'https',
28
- },
29
- {
30
- url: `${appId}-3.algolianet.com`,
31
- accept: 'readWrite',
32
- protocol: 'https',
33
- },
34
- ]));
35
- }
36
- // eslint-disable-next-line @typescript-eslint/explicit-function-return-type
37
- function createRecommendClient({ appId: appIdOption, apiKey: apiKeyOption, authMode, algoliaAgents, ...options }) {
38
- const auth = createAuth(appIdOption, apiKeyOption, authMode);
39
- const transporter = createTransporter({
40
- hosts: getDefaultHosts(appIdOption),
41
- ...options,
42
- algoliaAgent: getAlgoliaAgent({
43
- algoliaAgents,
44
- client: 'Recommend',
45
- version: apiClientVersion,
46
- }),
47
- baseHeaders: {
48
- 'content-type': 'text/plain',
49
- ...auth.headers(),
50
- ...options.baseHeaders,
51
- },
52
- baseQueryParameters: {
53
- ...auth.queryParameters(),
54
- ...options.baseQueryParameters,
55
- },
56
- });
57
- return {
58
- transporter,
59
- /**
60
- * The `appId` currently in use.
61
- */
62
- appId: appIdOption,
63
- /**
64
- * Clears the cache of the transporter for the `requestsCache` and `responsesCache` properties.
65
- */
66
- clearCache() {
67
- return Promise.all([transporter.requestsCache.clear(), transporter.responsesCache.clear()]).then(() => undefined);
68
- },
69
- /**
70
- * Get the value of the `algoliaAgent`, used by our libraries internally and telemetry system.
71
- */
72
- get _ua() {
73
- return transporter.algoliaAgent.value;
74
- },
75
- /**
76
- * Adds a `segment` to the `x-algolia-agent` sent with every requests.
77
- *
78
- * @param segment - The algolia agent (user-agent) segment to add.
79
- * @param version - The version of the agent.
80
- */
81
- addAlgoliaAgent(segment, version) {
82
- transporter.algoliaAgent.add({ segment, version });
83
- },
84
- /**
85
- * This method allow you to send requests to the Algolia REST API.
86
- *
87
- * @param customDelete - The customDelete object.
88
- * @param customDelete.path - Path of the endpoint, anything after \"/1\" must be specified.
89
- * @param customDelete.parameters - Query parameters to apply to the current query.
90
- * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
91
- */
92
- customDelete({ path, parameters }, requestOptions) {
93
- if (!path) {
94
- throw new Error('Parameter `path` is required when calling `customDelete`.');
95
- }
96
- const requestPath = '/{path}'.replace('{path}', path);
97
- const headers = {};
98
- const queryParameters = parameters ? parameters : {};
99
- const request = {
100
- method: 'DELETE',
101
- path: requestPath,
102
- queryParameters,
103
- headers,
104
- };
105
- return transporter.request(request, requestOptions);
106
- },
107
- /**
108
- * This method allow you to send requests to the Algolia REST API.
109
- *
110
- * @param customGet - The customGet object.
111
- * @param customGet.path - Path of the endpoint, anything after \"/1\" must be specified.
112
- * @param customGet.parameters - Query parameters to apply to the current query.
113
- * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
114
- */
115
- customGet({ path, parameters }, requestOptions) {
116
- if (!path) {
117
- throw new Error('Parameter `path` is required when calling `customGet`.');
118
- }
119
- const requestPath = '/{path}'.replace('{path}', path);
120
- const headers = {};
121
- const queryParameters = parameters ? parameters : {};
122
- const request = {
123
- method: 'GET',
124
- path: requestPath,
125
- queryParameters,
126
- headers,
127
- };
128
- return transporter.request(request, requestOptions);
129
- },
130
- /**
131
- * This method allow you to send requests to the Algolia REST API.
132
- *
133
- * @param customPost - The customPost object.
134
- * @param customPost.path - Path of the endpoint, anything after \"/1\" must be specified.
135
- * @param customPost.parameters - Query parameters to apply to the current query.
136
- * @param customPost.body - Parameters to send with the custom request.
137
- * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
138
- */
139
- customPost({ path, parameters, body }, requestOptions) {
140
- if (!path) {
141
- throw new Error('Parameter `path` is required when calling `customPost`.');
142
- }
143
- const requestPath = '/{path}'.replace('{path}', path);
144
- const headers = {};
145
- const queryParameters = parameters ? parameters : {};
146
- const request = {
147
- method: 'POST',
148
- path: requestPath,
149
- queryParameters,
150
- headers,
151
- data: body ? body : {},
152
- };
153
- return transporter.request(request, requestOptions);
154
- },
155
- /**
156
- * This method allow you to send requests to the Algolia REST API.
157
- *
158
- * @param customPut - The customPut object.
159
- * @param customPut.path - Path of the endpoint, anything after \"/1\" must be specified.
160
- * @param customPut.parameters - Query parameters to apply to the current query.
161
- * @param customPut.body - Parameters to send with the custom request.
162
- * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
163
- */
164
- customPut({ path, parameters, body }, requestOptions) {
165
- if (!path) {
166
- throw new Error('Parameter `path` is required when calling `customPut`.');
167
- }
168
- const requestPath = '/{path}'.replace('{path}', path);
169
- const headers = {};
170
- const queryParameters = parameters ? parameters : {};
171
- const request = {
172
- method: 'PUT',
173
- path: requestPath,
174
- queryParameters,
175
- headers,
176
- data: body ? body : {},
177
- };
178
- return transporter.request(request, requestOptions);
179
- },
180
- /**
181
- * Deletes a Recommend rule from a recommendation scenario.
182
- *
183
- * Required API Key ACLs:
184
- * - editSettings.
185
- *
186
- * @param deleteRecommendRule - The deleteRecommendRule object.
187
- * @param deleteRecommendRule.indexName - Name of the index on which to perform the operation.
188
- * @param deleteRecommendRule.model - [Recommend model](https://www.algolia.com/doc/guides/algolia-recommend/overview/#recommend-models).
189
- * @param deleteRecommendRule.objectID - Unique record identifier.
190
- * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
191
- */
192
- deleteRecommendRule({ indexName, model, objectID }, requestOptions) {
193
- if (!indexName) {
194
- throw new Error('Parameter `indexName` is required when calling `deleteRecommendRule`.');
195
- }
196
- if (!model) {
197
- throw new Error('Parameter `model` is required when calling `deleteRecommendRule`.');
198
- }
199
- if (!objectID) {
200
- throw new Error('Parameter `objectID` is required when calling `deleteRecommendRule`.');
201
- }
202
- const requestPath = '/1/indexes/{indexName}/{model}/recommend/rules/{objectID}'
203
- .replace('{indexName}', encodeURIComponent(indexName))
204
- .replace('{model}', encodeURIComponent(model))
205
- .replace('{objectID}', encodeURIComponent(objectID));
206
- const headers = {};
207
- const queryParameters = {};
208
- const request = {
209
- method: 'DELETE',
210
- path: requestPath,
211
- queryParameters,
212
- headers,
213
- };
214
- return transporter.request(request, requestOptions);
215
- },
216
- /**
217
- * Retrieves a Recommend rule that you previously created in the Algolia dashboard.
218
- *
219
- * Required API Key ACLs:
220
- * - settings.
221
- *
222
- * @param getRecommendRule - The getRecommendRule object.
223
- * @param getRecommendRule.indexName - Name of the index on which to perform the operation.
224
- * @param getRecommendRule.model - [Recommend model](https://www.algolia.com/doc/guides/algolia-recommend/overview/#recommend-models).
225
- * @param getRecommendRule.objectID - Unique record identifier.
226
- * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
227
- */
228
- getRecommendRule({ indexName, model, objectID }, requestOptions) {
229
- if (!indexName) {
230
- throw new Error('Parameter `indexName` is required when calling `getRecommendRule`.');
231
- }
232
- if (!model) {
233
- throw new Error('Parameter `model` is required when calling `getRecommendRule`.');
234
- }
235
- if (!objectID) {
236
- throw new Error('Parameter `objectID` is required when calling `getRecommendRule`.');
237
- }
238
- const requestPath = '/1/indexes/{indexName}/{model}/recommend/rules/{objectID}'
239
- .replace('{indexName}', encodeURIComponent(indexName))
240
- .replace('{model}', encodeURIComponent(model))
241
- .replace('{objectID}', encodeURIComponent(objectID));
242
- const headers = {};
243
- const queryParameters = {};
244
- const request = {
245
- method: 'GET',
246
- path: requestPath,
247
- queryParameters,
248
- headers,
249
- };
250
- return transporter.request(request, requestOptions);
251
- },
252
- /**
253
- * 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.
254
- *
255
- * Required API Key ACLs:
256
- * - editSettings.
257
- *
258
- * @param getRecommendStatus - The getRecommendStatus object.
259
- * @param getRecommendStatus.indexName - Name of the index on which to perform the operation.
260
- * @param getRecommendStatus.model - [Recommend model](https://www.algolia.com/doc/guides/algolia-recommend/overview/#recommend-models).
261
- * @param getRecommendStatus.taskID - Unique task identifier.
262
- * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
263
- */
264
- getRecommendStatus({ indexName, model, taskID }, requestOptions) {
265
- if (!indexName) {
266
- throw new Error('Parameter `indexName` is required when calling `getRecommendStatus`.');
267
- }
268
- if (!model) {
269
- throw new Error('Parameter `model` is required when calling `getRecommendStatus`.');
270
- }
271
- if (!taskID) {
272
- throw new Error('Parameter `taskID` is required when calling `getRecommendStatus`.');
273
- }
274
- const requestPath = '/1/indexes/{indexName}/{model}/task/{taskID}'
275
- .replace('{indexName}', encodeURIComponent(indexName))
276
- .replace('{model}', encodeURIComponent(model))
277
- .replace('{taskID}', encodeURIComponent(taskID));
278
- const headers = {};
279
- const queryParameters = {};
280
- const request = {
281
- method: 'GET',
282
- path: requestPath,
283
- queryParameters,
284
- headers,
285
- };
286
- return transporter.request(request, requestOptions);
287
- },
288
- /**
289
- * Retrieves recommendations from selected AI models.
290
- *
291
- * Required API Key ACLs:
292
- * - search.
293
- *
294
- * @param getRecommendationsParams - The getRecommendationsParams object.
295
- * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
296
- */
297
- getRecommendations(getRecommendationsParams, requestOptions) {
298
- if (getRecommendationsParams && Array.isArray(getRecommendationsParams)) {
299
- const newSignatureRequest = {
300
- requests: getRecommendationsParams,
301
- };
302
- // eslint-disable-next-line no-param-reassign
303
- getRecommendationsParams = newSignatureRequest;
304
- }
305
- if (!getRecommendationsParams) {
306
- throw new Error('Parameter `getRecommendationsParams` is required when calling `getRecommendations`.');
307
- }
308
- if (!getRecommendationsParams.requests) {
309
- throw new Error('Parameter `getRecommendationsParams.requests` is required when calling `getRecommendations`.');
310
- }
311
- const requestPath = '/1/indexes/*/recommendations';
312
- const headers = {};
313
- const queryParameters = {};
314
- const request = {
315
- method: 'POST',
316
- path: requestPath,
317
- queryParameters,
318
- headers,
319
- data: getRecommendationsParams,
320
- useReadTransporter: true,
321
- cacheable: true,
322
- };
323
- return transporter.request(request, requestOptions);
324
- },
325
- /**
326
- * Searches for Recommend rules. Use an empty query to list all rules for this recommendation scenario.
327
- *
328
- * Required API Key ACLs:
329
- * - settings.
330
- *
331
- * @param searchRecommendRules - The searchRecommendRules object.
332
- * @param searchRecommendRules.indexName - Name of the index on which to perform the operation.
333
- * @param searchRecommendRules.model - [Recommend model](https://www.algolia.com/doc/guides/algolia-recommend/overview/#recommend-models).
334
- * @param searchRecommendRules.searchRecommendRulesParams - The searchRecommendRulesParams object.
335
- * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
336
- */
337
- searchRecommendRules({ indexName, model, searchRecommendRulesParams }, requestOptions) {
338
- if (!indexName) {
339
- throw new Error('Parameter `indexName` is required when calling `searchRecommendRules`.');
340
- }
341
- if (!model) {
342
- throw new Error('Parameter `model` is required when calling `searchRecommendRules`.');
343
- }
344
- const requestPath = '/1/indexes/{indexName}/{model}/recommend/rules/search'
345
- .replace('{indexName}', encodeURIComponent(indexName))
346
- .replace('{model}', encodeURIComponent(model));
347
- const headers = {};
348
- const queryParameters = {};
349
- const request = {
350
- method: 'POST',
351
- path: requestPath,
352
- queryParameters,
353
- headers,
354
- data: searchRecommendRulesParams ? searchRecommendRulesParams : {},
355
- useReadTransporter: true,
356
- cacheable: true,
357
- };
358
- return transporter.request(request, requestOptions);
359
- },
360
- };
361
- }
362
-
363
- // 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.
364
- // eslint-disable-next-line @typescript-eslint/explicit-function-return-type
365
- function recommendClient(appId, apiKey, options) {
366
- if (!appId || typeof appId !== 'string') {
367
- throw new Error('`appId` is missing.');
368
- }
369
- if (!apiKey || typeof apiKey !== 'string') {
370
- throw new Error('`apiKey` is missing.');
371
- }
372
- return {
373
- ...createRecommendClient({
374
- appId,
375
- apiKey,
376
- timeouts: {
377
- connect: DEFAULT_CONNECT_TIMEOUT_NODE,
378
- read: DEFAULT_READ_TIMEOUT_NODE,
379
- write: DEFAULT_WRITE_TIMEOUT_NODE,
380
- },
381
- requester: createHttpRequester(),
382
- algoliaAgents: [{ segment: 'Node.js', version: process.versions.node }],
383
- responsesCache: createNullCache(),
384
- requestsCache: createNullCache(),
385
- hostsCache: createMemoryCache(),
386
- ...options,
387
- }),
388
- };
389
- }
390
-
391
- export { apiClientVersion, recommendClient };
@@ -1,2 +0,0 @@
1
- /*! recommend.umd.js | 5.2.4 | © 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,t,r){return(t=function(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+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class i extends Error{constructor(e,t){super(e),n(this,"name","AlgoliaError"),t&&(this.name=t)}}class c extends i{constructor(e,t,r){super(e,r),n(this,"stackTrace",void 0),this.stackTrace=t}}class l extends c{constructor(e){super("Unreachable hosts - your application id may be incorrect. If the error persists, please reach out to the Algolia Support team: https://alg.li/support.",e,"RetryError")}}class u extends c{constructor(e,t,r,a="ApiError"){super(e,r,a),n(this,"status",void 0),this.status=t}}class m extends i{constructor(e,t){super(e,"DeserializationError"),n(this,"response",void 0),this.response=t}}class d extends u{constructor(e,t,r,a){super(e,t,a,"DetailedApiError"),n(this,"error",void 0),this.error=r}}function h(e,t,r){const a=(s=r,Object.keys(s).filter((e=>void 0!==s[e])).sort().map((e=>`${e}=${encodeURIComponent("[object Array]"===Object.prototype.toString.call(s[e])?s[e].join(","):s[e]).replaceAll("+","%20")}`)).join("&"));var s;let o=`${e.protocol}://${e.url}${e.port?`:${e.port}`:""}/${"/"===t.charAt(0)?t.substring(1):t}`;return a.length&&(o+=`?${a}`),o}function p(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 g({hosts:e,hostsCache:t,baseHeaders:r,baseQueryParameters:a,algoliaAgent:s,timeouts:n,requester:i,requestsCache:c,responsesCache:g}){async function f(c,g,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,g),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,g.headers),q="GET"===c.method?{...c.data,...g.data}:{},v={...a,...c.queryParameters,...q};if(s.value&&(v["x-algolia-agent"]=s.value),g&&g.queryParameters)for(const e of Object.keys(g.queryParameters))g.queryParameters[e]&&"[object Object]"!==Object.prototype.toString.call(g.queryParameters[e])?v[e]=g.queryParameters[e].toString():v[e]=g.queryParameters[e];let b=0;const R=async(e,r)=>{const a=e.pop();if(void 0===a)throw new l(function(e){return e.map((e=>p(e)))}(w));const s={...n,...g.timeouts},q={data:y,headers:P,method:c.method,url:h(a,c.path,v),connectTimeout:r(b,s.connect),responseTimeout:r(b,f?s.read:s.write)},T=t=>{const r={request:q,response:t,host:a,triesLeft:e.length};return w.push(r),r},E=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)}(E)){const s=T(E);return E.isTimedOut&&b++,console.log("Retryable failure",p(s)),await t.set(a,o(a,E.isTimedOut?"timed out":"down")),R(e,r)}if(function({status:e}){return 2==~~(e/100)}(E))return function(e){try{return JSON.parse(e.content)}catch(t){throw new m(t.message,e)}}(E);throw T(E),function({content:e,status:t},r){try{const a=JSON.parse(e);return"error"in a?new d(a.message,t,a.error,r):new u(a.message,t,r)}catch{}return new u(e,t,r)}(E,w)},T=e.filter((e=>"readWrite"===e.accept||(f?"read"===e.accept:"write"===e.accept))),E=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([...E.hosts].reverse(),E.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 g.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=>g.set(n,e)})},requestsCache:c,responsesCache:g}}function f({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 w="5.2.4";function y(e){return[{url:`${e}-dsn.algolia.net`,accept:"read",protocol:"https"},{url:`${e}.algolia.net`,accept:"write",protocol:"https"}].concat(function(e){const t=e;for(let r=e.length-1;r>0;r--){const 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=w,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=g({hosts:y(e),...s,algoliaAgent:f({algoliaAgents:a,client:"Recommend",version:w}),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&&Array.isArray(e)&&(e={requests:e}),!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:`${w}-${e}`}),a()]}),...o})}}));
@@ -1,132 +0,0 @@
1
- import type { CreateClientOptions, RequestOptions } from '@algolia/client-common';
2
- import type { CustomDeleteProps, CustomGetProps, CustomPostProps, CustomPutProps, DeleteRecommendRuleProps, GetRecommendRuleProps, GetRecommendStatusProps, LegacyGetRecommendationsParams, SearchRecommendRulesProps } from '../model/clientMethodProps';
3
- import type { DeletedAtResponse } from '../model/deletedAtResponse';
4
- import type { GetRecommendTaskResponse } from '../model/getRecommendTaskResponse';
5
- import type { GetRecommendationsParams } from '../model/getRecommendationsParams';
6
- import type { GetRecommendationsResponse } from '../model/getRecommendationsResponse';
7
- import type { RecommendRule } from '../model/recommendRule';
8
- import type { SearchRecommendRulesResponse } from '../model/searchRecommendRulesResponse';
9
- export declare const apiClientVersion = "5.2.4";
10
- export declare function createRecommendClient({ appId: appIdOption, apiKey: apiKeyOption, authMode, algoliaAgents, ...options }: CreateClientOptions): {
11
- transporter: import("@algolia/client-common").Transporter;
12
- /**
13
- * The `appId` currently in use.
14
- */
15
- appId: string;
16
- /**
17
- * Clears the cache of the transporter for the `requestsCache` and `responsesCache` properties.
18
- */
19
- clearCache(): Promise<void>;
20
- /**
21
- * Get the value of the `algoliaAgent`, used by our libraries internally and telemetry system.
22
- */
23
- readonly _ua: string;
24
- /**
25
- * Adds a `segment` to the `x-algolia-agent` sent with every requests.
26
- *
27
- * @param segment - The algolia agent (user-agent) segment to add.
28
- * @param version - The version of the agent.
29
- */
30
- addAlgoliaAgent(segment: string, version?: string): void;
31
- /**
32
- * This method allow you to send requests to the Algolia REST API.
33
- *
34
- * @param customDelete - The customDelete object.
35
- * @param customDelete.path - Path of the endpoint, anything after \"/1\" must be specified.
36
- * @param customDelete.parameters - Query parameters to apply to the current query.
37
- * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
38
- */
39
- customDelete({ path, parameters }: CustomDeleteProps, requestOptions?: RequestOptions): Promise<Record<string, unknown>>;
40
- /**
41
- * This method allow you to send requests to the Algolia REST API.
42
- *
43
- * @param customGet - The customGet object.
44
- * @param customGet.path - Path of the endpoint, anything after \"/1\" must be specified.
45
- * @param customGet.parameters - Query parameters to apply to the current query.
46
- * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
47
- */
48
- customGet({ path, parameters }: CustomGetProps, requestOptions?: RequestOptions): Promise<Record<string, unknown>>;
49
- /**
50
- * This method allow you to send requests to the Algolia REST API.
51
- *
52
- * @param customPost - The customPost object.
53
- * @param customPost.path - Path of the endpoint, anything after \"/1\" must be specified.
54
- * @param customPost.parameters - Query parameters to apply to the current query.
55
- * @param customPost.body - Parameters to send with the custom request.
56
- * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
57
- */
58
- customPost({ path, parameters, body }: CustomPostProps, requestOptions?: RequestOptions): Promise<Record<string, unknown>>;
59
- /**
60
- * This method allow you to send requests to the Algolia REST API.
61
- *
62
- * @param customPut - The customPut object.
63
- * @param customPut.path - Path of the endpoint, anything after \"/1\" must be specified.
64
- * @param customPut.parameters - Query parameters to apply to the current query.
65
- * @param customPut.body - Parameters to send with the custom request.
66
- * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
67
- */
68
- customPut({ path, parameters, body }: CustomPutProps, requestOptions?: RequestOptions): Promise<Record<string, unknown>>;
69
- /**
70
- * Deletes a Recommend rule from a recommendation scenario.
71
- *
72
- * Required API Key ACLs:
73
- * - editSettings.
74
- *
75
- * @param deleteRecommendRule - The deleteRecommendRule object.
76
- * @param deleteRecommendRule.indexName - Name of the index on which to perform the operation.
77
- * @param deleteRecommendRule.model - [Recommend model](https://www.algolia.com/doc/guides/algolia-recommend/overview/#recommend-models).
78
- * @param deleteRecommendRule.objectID - Unique record identifier.
79
- * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
80
- */
81
- deleteRecommendRule({ indexName, model, objectID }: DeleteRecommendRuleProps, requestOptions?: RequestOptions): Promise<DeletedAtResponse>;
82
- /**
83
- * Retrieves a Recommend rule that you previously created in the Algolia dashboard.
84
- *
85
- * Required API Key ACLs:
86
- * - settings.
87
- *
88
- * @param getRecommendRule - The getRecommendRule object.
89
- * @param getRecommendRule.indexName - Name of the index on which to perform the operation.
90
- * @param getRecommendRule.model - [Recommend model](https://www.algolia.com/doc/guides/algolia-recommend/overview/#recommend-models).
91
- * @param getRecommendRule.objectID - Unique record identifier.
92
- * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
93
- */
94
- getRecommendRule({ indexName, model, objectID }: GetRecommendRuleProps, requestOptions?: RequestOptions): Promise<RecommendRule>;
95
- /**
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.
100
- *
101
- * @param getRecommendStatus - The getRecommendStatus object.
102
- * @param getRecommendStatus.indexName - Name of the index on which to perform the operation.
103
- * @param getRecommendStatus.model - [Recommend model](https://www.algolia.com/doc/guides/algolia-recommend/overview/#recommend-models).
104
- * @param getRecommendStatus.taskID - Unique task identifier.
105
- * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
106
- */
107
- getRecommendStatus({ indexName, model, taskID }: GetRecommendStatusProps, requestOptions?: RequestOptions): Promise<GetRecommendTaskResponse>;
108
- /**
109
- * Retrieves recommendations from selected AI models.
110
- *
111
- * Required API Key ACLs:
112
- * - search.
113
- *
114
- * @param getRecommendationsParams - The getRecommendationsParams object.
115
- * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
116
- */
117
- getRecommendations(getRecommendationsParams: GetRecommendationsParams | LegacyGetRecommendationsParams, requestOptions?: RequestOptions): Promise<GetRecommendationsResponse>;
118
- /**
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.
123
- *
124
- * @param searchRecommendRules - The searchRecommendRules object.
125
- * @param searchRecommendRules.indexName - Name of the index on which to perform the operation.
126
- * @param searchRecommendRules.model - [Recommend model](https://www.algolia.com/doc/guides/algolia-recommend/overview/#recommend-models).
127
- * @param searchRecommendRules.searchRecommendRulesParams - The searchRecommendRulesParams object.
128
- * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
129
- */
130
- searchRecommendRules({ indexName, model, searchRecommendRulesParams }: SearchRecommendRulesProps, requestOptions?: RequestOptions): Promise<SearchRecommendRulesResponse>;
131
- };
132
- //# sourceMappingURL=recommendClient.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"recommendClient.d.ts","sourceRoot":"","sources":["../../src/recommendClient.ts"],"names":[],"mappings":"AAGA,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,8BAA8B,EAC9B,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,UAAU,CAAC;AAsCxC,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,OAAO,CAAC,IAAI,CAAC;IAI3B;;OAEG;;IAKH;;;;;OAKG;6BACsB,MAAM,YAAY,MAAM,GAAG,IAAI;IAIxD;;;;;;;OAOG;uCAEqB,iBAAiB,mBACtB,cAAc,GAC9B,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAmBnC;;;;;;;OAOG;oCAC6B,cAAc,mBAAmB,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAmBlH;;;;;;;;OAQG;2CAE2B,eAAe,mBAC1B,cAAc,GAC9B,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAoBnC;;;;;;;;OAQG;0CAE2B,cAAc,mBACzB,cAAc,GAC9B,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAoBnC;;;;;;;;;;;OAWG;wDAE+B,wBAAwB,mBACvC,cAAc,GAC9B,OAAO,CAAC,iBAAiB,CAAC;IA8B7B;;;;;;;;;;;OAWG;qDAE+B,qBAAqB,mBACpC,cAAc,GAC9B,OAAO,CAAC,aAAa,CAAC;IA8BzB;;;;;;;;;;;OAWG;qDAE6B,uBAAuB,mBACpC,cAAc,GAC9B,OAAO,CAAC,wBAAwB,CAAC;IA8BpC;;;;;;;;OAQG;iDAEyB,wBAAwB,GAAG,8BAA8B,mBAClE,cAAc,GAC9B,OAAO,CAAC,0BAA0B,CAAC;IAmCtC;;;;;;;;;;;OAWG;2EAEiD,yBAAyB,mBAC1D,cAAc,GAC9B,OAAO,CAAC,4BAA4B,CAAC;EA4B3C"}