@algolia/client-search 5.0.0-alpha.99 → 5.0.0-beta.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (291) hide show
  1. package/LICENSE +21 -0
  2. package/dist/builds/browser.d.ts +91 -3
  3. package/dist/builds/browser.d.ts.map +1 -1
  4. package/dist/builds/node.d.ts +109 -3
  5. package/dist/builds/node.d.ts.map +1 -1
  6. package/dist/client-search.cjs +544 -219
  7. package/dist/client-search.esm.browser.js +494 -228
  8. package/dist/client-search.esm.node.js +545 -220
  9. package/dist/client-search.umd.js +2 -2
  10. package/dist/model/acl.d.ts +1 -1
  11. package/dist/model/action.d.ts +1 -1
  12. package/dist/model/addApiKeyResponse.d.ts +1 -1
  13. package/dist/model/anchoring.d.ts +1 -1
  14. package/dist/model/apiKey.d.ts +8 -8
  15. package/dist/model/apiKeyOperation.d.ts +2 -0
  16. package/dist/model/apiKeyOperation.d.ts.map +1 -0
  17. package/dist/model/aroundPrecision.d.ts +1 -1
  18. package/dist/model/aroundPrecisionFromValueInner.d.ts +9 -0
  19. package/dist/model/aroundPrecisionFromValueInner.d.ts.map +1 -1
  20. package/dist/model/aroundRadius.d.ts +1 -1
  21. package/dist/model/aroundRadiusAll.d.ts +3 -0
  22. package/dist/model/aroundRadiusAll.d.ts.map +1 -1
  23. package/dist/model/automaticFacetFilter.d.ts +4 -4
  24. package/dist/model/automaticFacetFilters.d.ts +1 -1
  25. package/dist/model/baseGetApiKeyResponse.d.ts +1 -1
  26. package/dist/model/baseIndexSettings.d.ts +23 -18
  27. package/dist/model/baseIndexSettings.d.ts.map +1 -1
  28. package/dist/model/baseSearchParamsWithoutQuery.d.ts +26 -29
  29. package/dist/model/baseSearchParamsWithoutQuery.d.ts.map +1 -1
  30. package/dist/model/baseSearchResponse.d.ts +8 -20
  31. package/dist/model/baseSearchResponse.d.ts.map +1 -1
  32. package/dist/model/batchDictionaryEntriesParams.d.ts +3 -3
  33. package/dist/model/batchResponse.d.ts +2 -2
  34. package/dist/model/browsePagination.d.ts +19 -0
  35. package/dist/model/browsePagination.d.ts.map +1 -0
  36. package/dist/model/browseResponse.d.ts +2 -1
  37. package/dist/model/browseResponse.d.ts.map +1 -1
  38. package/dist/model/builtInOperation.d.ts +2 -2
  39. package/dist/model/builtInOperationType.d.ts +1 -1
  40. package/dist/model/clientMethodProps.d.ts +137 -70
  41. package/dist/model/clientMethodProps.d.ts.map +1 -1
  42. package/dist/model/condition.d.ts +7 -3
  43. package/dist/model/condition.d.ts.map +1 -1
  44. package/dist/model/consequence.d.ts +5 -5
  45. package/dist/model/consequenceHide.d.ts +2 -2
  46. package/dist/model/consequenceQuery.d.ts +1 -1
  47. package/dist/model/consequenceQueryObject.d.ts +2 -2
  48. package/dist/model/createdAtResponse.d.ts +1 -1
  49. package/dist/model/cursor.d.ts +1 -1
  50. package/dist/model/deleteApiKeyResponse.d.ts +1 -1
  51. package/dist/model/deleteByParams.d.ts +4 -4
  52. package/dist/model/deleteSourceResponse.d.ts +1 -1
  53. package/dist/model/deletedAtResponse.d.ts +2 -2
  54. package/dist/model/dictionaryEntry.d.ts +6 -8
  55. package/dist/model/dictionaryEntry.d.ts.map +1 -1
  56. package/dist/model/dictionaryEntryState.d.ts +1 -1
  57. package/dist/model/dictionaryLanguage.d.ts +2 -2
  58. package/dist/model/dictionarySettingsParams.d.ts +1 -1
  59. package/dist/model/distinct.d.ts +1 -1
  60. package/dist/model/edit.d.ts +1 -1
  61. package/dist/model/exactOnSingleWordQuery.d.ts +1 -1
  62. package/dist/model/facetFilters.d.ts +2 -3
  63. package/dist/model/facetFilters.d.ts.map +1 -1
  64. package/dist/model/facetHits.d.ts +2 -2
  65. package/dist/model/facetOrdering.d.ts +2 -2
  66. package/dist/model/facets.d.ts +2 -2
  67. package/dist/model/fetchedIndex.d.ts +5 -1
  68. package/dist/model/fetchedIndex.d.ts.map +1 -1
  69. package/dist/model/getObjectsRequest.d.ts +3 -3
  70. package/dist/model/getObjectsResponse.d.ts +1 -1
  71. package/dist/model/hasPendingMappingsResponse.d.ts +1 -1
  72. package/dist/model/highlightResult.d.ts +1 -1
  73. package/dist/model/highlightResult.d.ts.map +1 -1
  74. package/dist/model/highlightResultOption.d.ts +3 -3
  75. package/dist/model/hit.d.ts +4 -4
  76. package/dist/model/ignorePlurals.d.ts +3 -2
  77. package/dist/model/ignorePlurals.d.ts.map +1 -1
  78. package/dist/model/index.d.ts +8 -1
  79. package/dist/model/index.d.ts.map +1 -1
  80. package/dist/model/indexSettings.d.ts +1 -1
  81. package/dist/model/indexSettingsAsSearchParams.d.ts +32 -35
  82. package/dist/model/indexSettingsAsSearchParams.d.ts.map +1 -1
  83. package/dist/model/log.d.ts +11 -11
  84. package/dist/model/logQuery.d.ts +1 -1
  85. package/dist/model/matchLevel.d.ts +1 -1
  86. package/dist/model/mode.d.ts +1 -1
  87. package/dist/model/multipleBatchRequest.d.ts +1 -1
  88. package/dist/model/multipleBatchResponse.d.ts +2 -2
  89. package/dist/model/numericFilters.d.ts +2 -3
  90. package/dist/model/numericFilters.d.ts.map +1 -1
  91. package/dist/model/operationIndexParams.d.ts +2 -2
  92. package/dist/model/operationType.d.ts +1 -1
  93. package/dist/model/optionalFilters.d.ts +2 -3
  94. package/dist/model/optionalFilters.d.ts.map +1 -1
  95. package/dist/model/params.d.ts +1 -1
  96. package/dist/model/promoteObjectID.d.ts +2 -2
  97. package/dist/model/promoteObjectIDs.d.ts +2 -2
  98. package/dist/model/queryType.d.ts +1 -1
  99. package/dist/model/rankingInfo.d.ts +13 -10
  100. package/dist/model/rankingInfo.d.ts.map +1 -1
  101. package/dist/model/reRankingApplyFilter.d.ts +2 -3
  102. package/dist/model/reRankingApplyFilter.d.ts.map +1 -1
  103. package/dist/model/redirect.d.ts +1 -1
  104. package/dist/model/redirectURL.d.ts +7 -0
  105. package/dist/model/redirectURL.d.ts.map +1 -0
  106. package/dist/model/removeStopWords.d.ts +3 -2
  107. package/dist/model/removeStopWords.d.ts.map +1 -1
  108. package/dist/model/removeUserIdResponse.d.ts +1 -1
  109. package/dist/model/removeWordsIfNoResults.d.ts +1 -1
  110. package/dist/model/renderingContent.d.ts +3 -1
  111. package/dist/model/renderingContent.d.ts.map +1 -1
  112. package/dist/model/replaceAllObjectsResponse.d.ts +11 -0
  113. package/dist/model/replaceAllObjectsResponse.d.ts.map +1 -0
  114. package/dist/model/replaceSourceResponse.d.ts +1 -1
  115. package/dist/model/rule.d.ts +5 -5
  116. package/dist/model/saveObjectResponse.d.ts +3 -3
  117. package/dist/model/saveSynonymResponse.d.ts +2 -2
  118. package/dist/model/searchDictionaryEntriesParams.d.ts +5 -7
  119. package/dist/model/searchDictionaryEntriesParams.d.ts.map +1 -1
  120. package/dist/model/searchDictionaryEntriesResponse.d.ts +20 -0
  121. package/dist/model/searchDictionaryEntriesResponse.d.ts.map +1 -0
  122. package/dist/model/searchForFacetValuesRequest.d.ts +1 -1
  123. package/dist/model/searchForFacetValuesResponse.d.ts +4 -1
  124. package/dist/model/searchForFacetValuesResponse.d.ts.map +1 -1
  125. package/dist/model/searchForFacetsOptions.d.ts +2 -2
  126. package/dist/model/searchForHitsOptions.d.ts +1 -1
  127. package/dist/model/searchHits.d.ts +6 -3
  128. package/dist/model/searchHits.d.ts.map +1 -1
  129. package/dist/model/searchPagination.d.ts +19 -0
  130. package/dist/model/searchPagination.d.ts.map +1 -0
  131. package/dist/model/searchParamsObject.d.ts +3 -0
  132. package/dist/model/searchParamsObject.d.ts.map +1 -1
  133. package/dist/model/searchParamsQuery.d.ts +1 -1
  134. package/dist/model/searchResponse.d.ts +2 -1
  135. package/dist/model/searchResponse.d.ts.map +1 -1
  136. package/dist/model/searchRulesParams.d.ts +4 -8
  137. package/dist/model/searchRulesParams.d.ts.map +1 -1
  138. package/dist/model/searchRulesResponse.d.ts +2 -2
  139. package/dist/model/searchStrategy.d.ts +1 -1
  140. package/dist/model/searchSynonymsParams.d.ts +2 -2
  141. package/dist/model/searchSynonymsResponse.d.ts +2 -2
  142. package/dist/model/searchUserIdsParams.d.ts +1 -1
  143. package/dist/model/searchUserIdsResponse.d.ts +3 -3
  144. package/dist/model/securedApiKeyRestrictions.d.ts +25 -0
  145. package/dist/model/securedApiKeyRestrictions.d.ts.map +1 -0
  146. package/dist/model/semanticSearch.d.ts +2 -2
  147. package/dist/model/snippetResult.d.ts +1 -1
  148. package/dist/model/snippetResult.d.ts.map +1 -1
  149. package/dist/model/snippetResultOption.d.ts +2 -2
  150. package/dist/model/sortRemainingBy.d.ts +1 -1
  151. package/dist/model/supportedLanguage.d.ts +5 -0
  152. package/dist/model/supportedLanguage.d.ts.map +1 -0
  153. package/dist/model/tagFilters.d.ts +2 -3
  154. package/dist/model/tagFilters.d.ts.map +1 -1
  155. package/dist/model/taskStatus.d.ts +1 -1
  156. package/dist/model/timeRange.d.ts +2 -2
  157. package/dist/model/typoTolerance.d.ts +1 -1
  158. package/dist/model/typoToleranceEnum.d.ts +3 -0
  159. package/dist/model/typoToleranceEnum.d.ts.map +1 -1
  160. package/dist/model/updateApiKeyResponse.d.ts +1 -1
  161. package/dist/model/updatedAtResponse.d.ts +2 -2
  162. package/dist/model/updatedAtWithObjectIdResponse.d.ts +3 -3
  163. package/dist/model/updatedRuleResponse.d.ts +3 -3
  164. package/dist/model/userHit.d.ts +1 -1
  165. package/dist/model/userId.d.ts +1 -1
  166. package/dist/model/value.d.ts +5 -1
  167. package/dist/model/value.d.ts.map +1 -1
  168. package/dist/src/searchClient.d.ts +385 -208
  169. package/dist/src/searchClient.d.ts.map +1 -1
  170. package/model/acl.ts +1 -1
  171. package/model/action.ts +1 -1
  172. package/model/addApiKeyResponse.ts +1 -1
  173. package/model/anchoring.ts +1 -1
  174. package/model/apiKey.ts +8 -8
  175. package/model/{mixedSearchFilters.ts → apiKeyOperation.ts} +1 -1
  176. package/model/aroundPrecision.ts +1 -1
  177. package/model/aroundPrecisionFromValueInner.ts +9 -0
  178. package/model/aroundRadius.ts +1 -1
  179. package/model/aroundRadiusAll.ts +3 -0
  180. package/model/automaticFacetFilter.ts +4 -4
  181. package/model/automaticFacetFilters.ts +1 -1
  182. package/model/baseGetApiKeyResponse.ts +1 -1
  183. package/model/baseIndexSettings.ts +25 -18
  184. package/model/baseSearchParamsWithoutQuery.ts +26 -30
  185. package/model/baseSearchResponse.ts +9 -24
  186. package/model/batchDictionaryEntriesParams.ts +3 -3
  187. package/model/batchResponse.ts +2 -2
  188. package/model/browsePagination.ts +23 -0
  189. package/model/browseResponse.ts +2 -0
  190. package/model/builtInOperation.ts +2 -2
  191. package/model/builtInOperationType.ts +1 -1
  192. package/model/clientMethodProps.ts +156 -70
  193. package/model/condition.ts +8 -3
  194. package/model/consequence.ts +5 -5
  195. package/model/consequenceHide.ts +2 -2
  196. package/model/consequenceQuery.ts +1 -1
  197. package/model/consequenceQueryObject.ts +2 -2
  198. package/model/createdAtResponse.ts +1 -1
  199. package/model/cursor.ts +1 -1
  200. package/model/deleteApiKeyResponse.ts +1 -1
  201. package/model/deleteByParams.ts +4 -4
  202. package/model/deleteSourceResponse.ts +1 -1
  203. package/model/deletedAtResponse.ts +2 -2
  204. package/model/dictionaryEntry.ts +6 -8
  205. package/model/dictionaryEntryState.ts +1 -1
  206. package/model/dictionaryLanguage.ts +2 -2
  207. package/model/dictionarySettingsParams.ts +1 -1
  208. package/model/distinct.ts +1 -1
  209. package/model/edit.ts +1 -1
  210. package/model/exactOnSingleWordQuery.ts +1 -1
  211. package/model/facetFilters.ts +2 -4
  212. package/model/facetHits.ts +2 -2
  213. package/model/facetOrdering.ts +2 -2
  214. package/model/facets.ts +2 -2
  215. package/model/fetchedIndex.ts +6 -1
  216. package/model/getObjectsRequest.ts +3 -3
  217. package/model/getObjectsResponse.ts +1 -1
  218. package/model/hasPendingMappingsResponse.ts +1 -1
  219. package/model/highlightResult.ts +1 -0
  220. package/model/highlightResultOption.ts +3 -3
  221. package/model/hit.ts +4 -4
  222. package/model/ignorePlurals.ts +4 -2
  223. package/model/index.ts +8 -1
  224. package/model/indexSettings.ts +1 -1
  225. package/model/indexSettingsAsSearchParams.ts +32 -36
  226. package/model/log.ts +11 -11
  227. package/model/logQuery.ts +1 -1
  228. package/model/matchLevel.ts +1 -1
  229. package/model/mode.ts +1 -1
  230. package/model/multipleBatchRequest.ts +1 -1
  231. package/model/multipleBatchResponse.ts +2 -2
  232. package/model/numericFilters.ts +2 -4
  233. package/model/operationIndexParams.ts +2 -2
  234. package/model/operationType.ts +1 -1
  235. package/model/optionalFilters.ts +2 -4
  236. package/model/params.ts +1 -1
  237. package/model/promoteObjectID.ts +2 -2
  238. package/model/promoteObjectIDs.ts +2 -2
  239. package/model/queryType.ts +1 -1
  240. package/model/rankingInfo.ts +13 -10
  241. package/model/reRankingApplyFilter.ts +2 -4
  242. package/model/redirect.ts +1 -1
  243. package/model/redirectURL.ts +8 -0
  244. package/model/removeStopWords.ts +4 -2
  245. package/model/removeUserIdResponse.ts +1 -1
  246. package/model/removeWordsIfNoResults.ts +1 -1
  247. package/model/renderingContent.ts +4 -1
  248. package/model/replaceAllObjectsResponse.ts +15 -0
  249. package/model/replaceSourceResponse.ts +1 -1
  250. package/model/rule.ts +5 -5
  251. package/model/saveObjectResponse.ts +3 -3
  252. package/model/saveSynonymResponse.ts +2 -2
  253. package/model/searchDictionaryEntriesParams.ts +6 -7
  254. package/model/searchDictionaryEntriesResponse.ts +25 -0
  255. package/model/searchForFacetValuesRequest.ts +1 -1
  256. package/model/searchForFacetValuesResponse.ts +4 -1
  257. package/model/searchForFacetsOptions.ts +2 -2
  258. package/model/searchForHitsOptions.ts +1 -1
  259. package/model/searchHits.ts +6 -3
  260. package/model/searchPagination.ts +23 -0
  261. package/model/searchParamsObject.ts +3 -0
  262. package/model/searchParamsQuery.ts +1 -1
  263. package/model/searchResponse.ts +3 -1
  264. package/model/searchRulesParams.ts +4 -9
  265. package/model/searchRulesResponse.ts +2 -2
  266. package/model/searchStrategy.ts +1 -1
  267. package/model/searchSynonymsParams.ts +2 -2
  268. package/model/searchSynonymsResponse.ts +2 -2
  269. package/model/searchUserIdsParams.ts +1 -1
  270. package/model/searchUserIdsResponse.ts +3 -3
  271. package/model/securedApiKeyRestrictions.ts +32 -0
  272. package/model/semanticSearch.ts +2 -2
  273. package/model/snippetResult.ts +2 -1
  274. package/model/snippetResultOption.ts +2 -2
  275. package/model/sortRemainingBy.ts +1 -1
  276. package/model/supportedLanguage.ts +74 -0
  277. package/model/tagFilters.ts +2 -4
  278. package/model/taskStatus.ts +1 -1
  279. package/model/timeRange.ts +2 -2
  280. package/model/typoTolerance.ts +1 -1
  281. package/model/typoToleranceEnum.ts +3 -0
  282. package/model/updateApiKeyResponse.ts +1 -1
  283. package/model/updatedAtResponse.ts +2 -2
  284. package/model/updatedAtWithObjectIdResponse.ts +3 -3
  285. package/model/updatedRuleResponse.ts +3 -3
  286. package/model/userHit.ts +1 -1
  287. package/model/userId.ts +1 -1
  288. package/model/value.ts +6 -1
  289. package/package.json +11 -8
  290. package/dist/model/mixedSearchFilters.d.ts +0 -2
  291. package/dist/model/mixedSearchFilters.d.ts.map +0 -1
@@ -1,10 +1,11 @@
1
1
  'use strict';
2
2
 
3
+ var crypto = require('crypto');
3
4
  var clientCommon = require('@algolia/client-common');
4
5
  var requesterNodeHttp = require('@algolia/requester-node-http');
5
6
 
6
7
  // 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.
7
- const apiClientVersion = '5.0.0-alpha.99';
8
+ const apiClientVersion = '5.0.0-beta.10';
8
9
  function getDefaultHosts(appId) {
9
10
  return [
10
11
  {
@@ -90,7 +91,7 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
90
91
  * Helper: Wait for a task to be published (completed) for a given `indexName` and `taskID`.
91
92
  *
92
93
  * @summary Helper method that waits for a task to be published (completed).
93
- * @param waitForTaskOptions - The waitForTaskOptions object.
94
+ * @param waitForTaskOptions - The `waitForTaskOptions` object.
94
95
  * @param waitForTaskOptions.indexName - The `indexName` where the operation was performed.
95
96
  * @param waitForTaskOptions.taskID - The `taskID` returned in the method response.
96
97
  * @param waitForTaskOptions.maxRetries - The maximum number of retries. 50 by default.
@@ -110,11 +111,34 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
110
111
  timeout: () => timeout(retryCount),
111
112
  });
112
113
  },
114
+ /**
115
+ * Helper: Wait for an application-level task to complete for a given `taskID`.
116
+ *
117
+ * @summary Helper method that waits for a task to be published (completed).
118
+ * @param waitForAppTaskOptions - The `waitForTaskOptions` object.
119
+ * @param waitForAppTaskOptions.taskID - The `taskID` returned in the method response.
120
+ * @param waitForAppTaskOptions.maxRetries - The maximum number of retries. 50 by default.
121
+ * @param waitForAppTaskOptions.timeout - The function to decide how long to wait between retries.
122
+ * @param requestOptions - The requestOptions to send along with the query, they will be forwarded to the `getTask` method and merged with the transporter requestOptions.
123
+ */
124
+ waitForAppTask({ taskID, maxRetries = 50, timeout = (retryCount) => Math.min(retryCount * 200, 5000), }, requestOptions) {
125
+ let retryCount = 0;
126
+ return clientCommon.createIterablePromise({
127
+ func: () => this.getAppTask({ taskID }, requestOptions),
128
+ validate: (response) => response.status === 'published',
129
+ aggregator: () => (retryCount += 1),
130
+ error: {
131
+ validate: () => retryCount >= maxRetries,
132
+ message: () => `The maximum number of retries exceeded. (${retryCount}/${maxRetries})`,
133
+ },
134
+ timeout: () => timeout(retryCount),
135
+ });
136
+ },
113
137
  /**
114
138
  * Helper: Wait for an API key to be added, updated or deleted based on a given `operation`.
115
139
  *
116
140
  * @summary Helper method that waits for an API key task to be processed.
117
- * @param waitForApiKeyOptions - The waitForApiKeyOptions object.
141
+ * @param waitForApiKeyOptions - The `waitForApiKeyOptions` object.
118
142
  * @param waitForApiKeyOptions.operation - The `operation` that was done on a `key`.
119
143
  * @param waitForApiKeyOptions.key - The `key` that has been added, deleted or updated.
120
144
  * @param waitForApiKeyOptions.apiKey - Necessary to know if an `update` operation has been processed, compare fields of the response with it.
@@ -167,7 +191,7 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
167
191
  * Helper: Iterate on the `browse` method of the client to allow aggregating objects of an index.
168
192
  *
169
193
  * @summary Helper method that iterates on the `browse` method.
170
- * @param browseObjects - The browseObjects object.
194
+ * @param browseObjects - The `browseObjects` object.
171
195
  * @param browseObjects.indexName - The index in which to perform the request.
172
196
  * @param browseObjects.browseParams - The `browse` parameters.
173
197
  * @param browseObjects.validate - The validator function. It receive the resolved return of the API call. By default, stops when there is no `cursor` in the response.
@@ -193,11 +217,11 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
193
217
  * Helper: Iterate on the `searchRules` method of the client to allow aggregating rules of an index.
194
218
  *
195
219
  * @summary Helper method that iterates on the `searchRules` method.
196
- * @param browseObjects - The browseObjects object.
197
- * @param browseObjects.indexName - The index in which to perform the request.
198
- * @param browseObjects.searchRulesParams - The `searchRules` method parameters.
199
- * @param browseObjects.validate - The validator function. It receive the resolved return of the API call. By default, stops when there is less hits returned than the number of maximum hits (1000).
200
- * @param browseObjects.aggregator - The function that runs right after the API call has been resolved, allows you to do anything with the response before `validate`.
220
+ * @param browseRules - The `browseRules` object.
221
+ * @param browseRules.indexName - The index in which to perform the request.
222
+ * @param browseRules.searchRulesParams - The `searchRules` method parameters.
223
+ * @param browseRules.validate - The validator function. It receive the resolved return of the API call. By default, stops when there is less hits returned than the number of maximum hits (1000).
224
+ * @param browseRules.aggregator - The function that runs right after the API call has been resolved, allows you to do anything with the response before `validate`.
201
225
  * @param requestOptions - The requestOptions to send along with the query, they will be forwarded to the `searchRules` method and merged with the transporter requestOptions.
202
226
  */
203
227
  browseRules({ indexName, searchRulesParams, ...browseRulesOptions }, requestOptions) {
@@ -225,11 +249,11 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
225
249
  * Helper: Iterate on the `searchSynonyms` method of the client to allow aggregating rules of an index.
226
250
  *
227
251
  * @summary Helper method that iterates on the `searchSynonyms` method.
228
- * @param browseObjects - The browseObjects object.
229
- * @param browseObjects.indexName - The index in which to perform the request.
230
- * @param browseObjects.validate - The validator function. It receive the resolved return of the API call. By default, stops when there is less hits returned than the number of maximum hits (1000).
231
- * @param browseObjects.aggregator - The function that runs right after the API call has been resolved, allows you to do anything with the response before `validate`.
232
- * @param browseObjects.searchSynonymsParams - The `searchSynonyms` method parameters.
252
+ * @param browseSynonyms - The `browseSynonyms` object.
253
+ * @param browseSynonyms.indexName - The index in which to perform the request.
254
+ * @param browseSynonyms.validate - The validator function. It receive the resolved return of the API call. By default, stops when there is less hits returned than the number of maximum hits (1000).
255
+ * @param browseSynonyms.aggregator - The function that runs right after the API call has been resolved, allows you to do anything with the response before `validate`.
256
+ * @param browseSynonyms.searchSynonymsParams - The `searchSynonyms` method parameters.
233
257
  * @param requestOptions - The requestOptions to send along with the query, they will be forwarded to the `searchSynonyms` method and merged with the transporter requestOptions.
234
258
  */
235
259
  browseSynonyms({ indexName, searchSynonymsParams, ...browseSynonymsOptions }, requestOptions) {
@@ -239,16 +263,16 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
239
263
  hitsPerPage: 1000,
240
264
  };
241
265
  return clientCommon.createIterablePromise({
242
- func: (previousResponse) => {
243
- return this.searchSynonyms({
266
+ func: (_) => {
267
+ const resp = this.searchSynonyms({
244
268
  indexName,
245
269
  searchSynonymsParams: {
246
270
  ...params,
247
- page: previousResponse
248
- ? previousResponse.page + 1
249
- : params.page,
271
+ page: params.page,
250
272
  },
251
273
  }, requestOptions);
274
+ params.page += 1;
275
+ return resp;
252
276
  },
253
277
  validate: (response) => response.nbHits < params.hitsPerPage,
254
278
  ...browseSynonymsOptions,
@@ -277,9 +301,137 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
277
301
  return this.search(searchMethodParams, requestOptions);
278
302
  },
279
303
  /**
280
- * Add a new API key with specific permissions and restrictions. The request must be authenticated with the admin API key. The response returns an API key string.
304
+ * Helper: Chunks the given `objects` list in subset of 1000 elements max in order to make it fit in `batch` requests.
305
+ *
306
+ * @summary Helper: Chunks the given `objects` list in subset of 1000 elements max in order to make it fit in `batch` requests.
307
+ * @param chunkedBatch - The `chunkedBatch` object.
308
+ * @param chunkedBatch.indexName - The `indexName` to replace `objects` in.
309
+ * @param chunkedBatch.objects - The array of `objects` to store in the given Algolia `indexName`.
310
+ * @param chunkedBatch.action - The `batch` `action` to perform on the given array of `objects`, defaults to `addObject`.
311
+ * @param chunkedBatch.waitForTasks - Whether or not we should wait until every `batch` tasks has been processed, this operation may slow the total execution time of this method but is more reliable.
312
+ * @param chunkedBatch.batchSize - The size of the chunk of `objects`. The number of `batch` calls will be equal to `length(objects) / batchSize`. Defaults to 1000.
313
+ * @param requestOptions - The requestOptions to send along with the query, they will be forwarded to the `getTask` method and merged with the transporter requestOptions.
314
+ */
315
+ async chunkedBatch({ indexName, objects, action = 'addObject', waitForTasks, batchSize = 1000, }, requestOptions) {
316
+ let requests = [];
317
+ const responses = [];
318
+ const objectEntries = objects.entries();
319
+ for (const [i, obj] of objectEntries) {
320
+ requests.push({ action, body: obj });
321
+ if (requests.length === batchSize || i === objects.length - 1) {
322
+ responses.push(await this.batch({ indexName, batchWriteParams: { requests } }, requestOptions));
323
+ requests = [];
324
+ }
325
+ }
326
+ if (waitForTasks) {
327
+ for (const resp of responses) {
328
+ await this.waitForTask({ indexName, taskID: resp.taskID });
329
+ }
330
+ }
331
+ return responses;
332
+ },
333
+ /**
334
+ * Helper: Saves the given array of objects in the given index. The `chunkedBatch` helper is used under the hood, which creates a `batch` requests with at most 1000 objects in it.
335
+ *
336
+ * @summary Helper: Saves the given array of objects in the given index. The `chunkedBatch` helper is used under the hood, which creates a `batch` requests with at most 1000 objects in it.
337
+ * @param saveObjects - The `saveObjects` object.
338
+ * @param saveObjects.indexName - The `indexName` to save `objects` in.
339
+ * @param saveObjects.objects - The array of `objects` to store in the given Algolia `indexName`.
340
+ * @param requestOptions - The requestOptions to send along with the query, they will be forwarded to the `batch` method and merged with the transporter requestOptions.
341
+ */
342
+ async saveObjects({ indexName, objects }, requestOptions) {
343
+ return await this.chunkedBatch({ indexName, objects, action: 'addObject' }, requestOptions);
344
+ },
345
+ /**
346
+ * Helper: Deletes every records for the given objectIDs. The `chunkedBatch` helper is used under the hood, which creates a `batch` requests with at most 1000 objectIDs in it.
347
+ *
348
+ * @summary Helper: Deletes every records for the given objectIDs. The `chunkedBatch` helper is used under the hood, which creates a `batch` requests with at most 1000 objectIDs in it.
349
+ * @param deleteObjects - The `deleteObjects` object.
350
+ * @param deleteObjects.indexName - The `indexName` to delete `objectIDs` from.
351
+ * @param deleteObjects.objectIDs - The objectIDs to delete.
352
+ * @param requestOptions - The requestOptions to send along with the query, they will be forwarded to the `batch` method and merged with the transporter requestOptions.
353
+ */
354
+ async deleteObjects({ indexName, objectIDs }, requestOptions) {
355
+ return await this.chunkedBatch({
356
+ indexName,
357
+ objects: objectIDs.map((objectID) => ({ objectID })),
358
+ action: 'deleteObject',
359
+ }, requestOptions);
360
+ },
361
+ /**
362
+ * Helper: Replaces object content of all the given objects according to their respective `objectID` field. The `chunkedBatch` helper is used under the hood, which creates a `batch` requests with at most 1000 objects in it.
363
+ *
364
+ * @summary Helper: Replaces object content of all the given objects according to their respective `objectID` field. The `chunkedBatch` helper is used under the hood, which creates a `batch` requests with at most 1000 objects in it.
365
+ * @param partialUpdateObjects - The `partialUpdateObjects` object.
366
+ * @param partialUpdateObjects.indexName - The `indexName` to update `objects` in.
367
+ * @param partialUpdateObjects.objects - The array of `objects` to update in the given Algolia `indexName`.
368
+ * @param partialUpdateObjects.createIfNotExists - To be provided if non-existing objects are passed, otherwise, the call will fail..
369
+ * @param requestOptions - The requestOptions to send along with the query, they will be forwarded to the `getTask` method and merged with the transporter requestOptions.
370
+ */
371
+ async partialUpdateObjects({ indexName, objects, createIfNotExists }, requestOptions) {
372
+ return await this.chunkedBatch({
373
+ indexName,
374
+ objects,
375
+ action: createIfNotExists
376
+ ? 'partialUpdateObject'
377
+ : 'partialUpdateObjectNoCreate',
378
+ }, requestOptions);
379
+ },
380
+ /**
381
+ * Helper: Replaces all objects (records) in the given `index_name` with the given `objects`. A temporary index is created during this process in order to backup your data.
382
+ * See https://api-clients-automation.netlify.app/docs/contributing/add-new-api-client#5-helpers for implementation details.
383
+ *
384
+ * @summary Helper: Replaces all objects (records) in the given `index_name` with the given `objects`. A temporary index is created during this process in order to backup your data.
385
+ * @param replaceAllObjects - The `replaceAllObjects` object.
386
+ * @param replaceAllObjects.indexName - The `indexName` to replace `objects` in.
387
+ * @param replaceAllObjects.objects - The array of `objects` to store in the given Algolia `indexName`.
388
+ * @param replaceAllObjects.batchSize - The size of the chunk of `objects`. The number of `batch` calls will be equal to `objects.length / batchSize`. Defaults to 1000.
389
+ * @param requestOptions - The requestOptions to send along with the query, they will be forwarded to the `batch`, `operationIndex` and `getTask` method and merged with the transporter requestOptions.
390
+ */
391
+ async replaceAllObjects({ indexName, objects, batchSize }, requestOptions) {
392
+ const randomSuffix = Math.floor(Math.random() * 1000000) + 100000;
393
+ const tmpIndexName = `${indexName}_tmp_${randomSuffix}`;
394
+ let copyOperationResponse = await this.operationIndex({
395
+ indexName,
396
+ operationIndexParams: {
397
+ operation: 'copy',
398
+ destination: tmpIndexName,
399
+ scope: ['settings', 'rules', 'synonyms'],
400
+ },
401
+ }, requestOptions);
402
+ const batchResponses = await this.chunkedBatch({ indexName: tmpIndexName, objects, waitForTasks: true, batchSize }, requestOptions);
403
+ await this.waitForTask({
404
+ indexName: tmpIndexName,
405
+ taskID: copyOperationResponse.taskID,
406
+ });
407
+ copyOperationResponse = await this.operationIndex({
408
+ indexName,
409
+ operationIndexParams: {
410
+ operation: 'copy',
411
+ destination: tmpIndexName,
412
+ scope: ['settings', 'rules', 'synonyms'],
413
+ },
414
+ }, requestOptions);
415
+ await this.waitForTask({
416
+ indexName: tmpIndexName,
417
+ taskID: copyOperationResponse.taskID,
418
+ });
419
+ const moveOperationResponse = await this.operationIndex({
420
+ indexName: tmpIndexName,
421
+ operationIndexParams: { operation: 'move', destination: indexName },
422
+ }, requestOptions);
423
+ await this.waitForTask({
424
+ indexName: tmpIndexName,
425
+ taskID: moveOperationResponse.taskID,
426
+ });
427
+ return { copyOperationResponse, batchResponses, moveOperationResponse };
428
+ },
429
+ /**
430
+ * Creates a new API key with specific permissions and restrictions.
431
+ *
432
+ * Required API Key ACLs:
433
+ * - admin.
281
434
  *
282
- * @summary Add API key.
283
435
  * @param apiKey - The apiKey object.
284
436
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
285
437
  */
@@ -303,13 +455,15 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
303
455
  return transporter.request(request, requestOptions);
304
456
  },
305
457
  /**
306
- * If you use an existing `objectID`, the existing record will be replaced with the new one. To update only some attributes of an existing record, use the [`partial` operation](#tag/Records/operation/partialUpdateObject) instead. To add multiple records to your index in a single API request, use the [`batch` operation](#tag/Records/operation/batch).
458
+ * If a record with the specified object ID exists, the existing record is replaced. Otherwise, a new record is added to the index. To update _some_ attributes of an existing record, use the [`partial` operation](#tag/Records/operation/partialUpdateObject) instead. To add, update, or replace multiple records, use the [`batch` operation](#tag/Records/operation/batch).
459
+ *
460
+ * Required API Key ACLs:
461
+ * - addObject.
307
462
  *
308
- * @summary Add or update a record (using objectID).
309
463
  * @param addOrUpdateObject - The addOrUpdateObject object.
310
- * @param addOrUpdateObject.indexName - Index on which to perform the request.
311
- * @param addOrUpdateObject.objectID - Unique record (object) identifier.
312
- * @param addOrUpdateObject.body - Algolia record.
464
+ * @param addOrUpdateObject.indexName - Name of the index on which to perform the operation.
465
+ * @param addOrUpdateObject.objectID - Unique record identifier.
466
+ * @param addOrUpdateObject.body - The record, a schemaless object with attributes that are useful in the context of search and discovery.
313
467
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
314
468
  */
315
469
  addOrUpdateObject({ indexName, objectID, body }, requestOptions) {
@@ -337,9 +491,11 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
337
491
  return transporter.request(request, requestOptions);
338
492
  },
339
493
  /**
340
- * Add a source to the list of allowed sources.
494
+ * Adds a source to the list of allowed sources.
495
+ *
496
+ * Required API Key ACLs:
497
+ * - admin.
341
498
  *
342
- * @summary Add a source.
343
499
  * @param source - Source to add.
344
500
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
345
501
  */
@@ -363,11 +519,13 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
363
519
  return transporter.request(request, requestOptions);
364
520
  },
365
521
  /**
366
- * Assign or move a user ID to a cluster. The time it takes to move a user is proportional to the amount of data linked to the user ID.
522
+ * Assigns or moves a user ID to a cluster. The time it takes to move a user is proportional to the amount of data linked to the user ID.
523
+ *
524
+ * Required API Key ACLs:
525
+ * - admin.
367
526
  *
368
- * @summary Assign or move a user ID.
369
527
  * @param assignUserId - The assignUserId object.
370
- * @param assignUserId.xAlgoliaUserID - UserID to assign.
528
+ * @param assignUserId.xAlgoliaUserID - Unique identifier of the user who makes the search request.
371
529
  * @param assignUserId.assignUserIdParams - The assignUserIdParams object.
372
530
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
373
531
  */
@@ -397,11 +555,10 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
397
555
  return transporter.request(request, requestOptions);
398
556
  },
399
557
  /**
400
- * To reduce the time spent on network round trips, you can perform several write actions in a single API call. Actions are applied in the order they are specified. The supported `action`s are equivalent to the individual operations of the same name.
558
+ * Adds, updates, or deletes records in one index with a single API request. Batching index updates reduces latency and increases data integrity. - Actions are applied in the order they\'re specified. - Actions are equivalent to the individual API requests of the same name.
401
559
  *
402
- * @summary Batch write operations on one index.
403
560
  * @param batch - The batch object.
404
- * @param batch.indexName - Index on which to perform the request.
561
+ * @param batch.indexName - Name of the index on which to perform the operation.
405
562
  * @param batch.batchWriteParams - The batchWriteParams object.
406
563
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
407
564
  */
@@ -428,11 +585,13 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
428
585
  return transporter.request(request, requestOptions);
429
586
  },
430
587
  /**
431
- * Assign multiple user IDs to a cluster. **You can\'t _move_ users with this operation.**.
588
+ * Assigns multiple user IDs to a cluster. **You can\'t move users with this operation**.
589
+ *
590
+ * Required API Key ACLs:
591
+ * - admin.
432
592
  *
433
- * @summary Batch assign userIDs.
434
593
  * @param batchAssignUserIds - The batchAssignUserIds object.
435
- * @param batchAssignUserIds.xAlgoliaUserID - UserID to assign.
594
+ * @param batchAssignUserIds.xAlgoliaUserID - Unique identifier of the user who makes the search request.
436
595
  * @param batchAssignUserIds.batchAssignUserIdsParams - The batchAssignUserIdsParams object.
437
596
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
438
597
  */
@@ -465,11 +624,13 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
465
624
  return transporter.request(request, requestOptions);
466
625
  },
467
626
  /**
468
- * Add or remove a batch of dictionary entries.
627
+ * Adds or deletes multiple entries from your plurals, segmentation, or stop word dictionaries.
628
+ *
629
+ * Required API Key ACLs:
630
+ * - editSettings.
469
631
  *
470
- * @summary Batch dictionary entries.
471
632
  * @param batchDictionaryEntries - The batchDictionaryEntries object.
472
- * @param batchDictionaryEntries.dictionaryName - Dictionary to search in.
633
+ * @param batchDictionaryEntries.dictionaryName - Dictionary type in which to search.
473
634
  * @param batchDictionaryEntries.batchDictionaryEntriesParams - The batchDictionaryEntriesParams object.
474
635
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
475
636
  */
@@ -496,11 +657,13 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
496
657
  return transporter.request(request, requestOptions);
497
658
  },
498
659
  /**
499
- * Retrieve up to 1,000 records per call. Supports full-text search and filters. For better performance, it doesn\'t support: - The `distinct` query parameter - Sorting by typos, proximity, words, or geographical distance.
660
+ * Retrieves records from an index, up to 1,000 per request. While searching retrieves _hits_ (records augmented with attributes for highlighting and ranking details), browsing _just_ returns matching records. This can be useful if you want to export your indices. - The Analytics API doesn\'t collect data when using `browse`. - Records are ranked by attributes and custom ranking. - There\'s no ranking for: typo-tolerance, number of matched words, proximity, geo distance. Browse requests automatically apply these settings: - `advancedSyntax`: `false` - `attributesToHighlight`: `[]` - `attributesToSnippet`: `[]` - `distinct`: `false` - `enablePersonalization`: `false` - `enableRules`: `false` - `facets`: `[]` - `getRankingInfo`: `false` - `ignorePlurals`: `false` - `optionalFilters`: `[]` - `typoTolerance`: `true` or `false` (`min` and `strict` is evaluated to `true`) If you send these parameters with your browse requests, they\'ll be ignored.
661
+ *
662
+ * Required API Key ACLs:
663
+ * - browse.
500
664
  *
501
- * @summary Get all records from an index.
502
665
  * @param browse - The browse object.
503
- * @param browse.indexName - Index on which to perform the request.
666
+ * @param browse.indexName - Name of the index on which to perform the operation.
504
667
  * @param browse.browseParams - The browseParams object.
505
668
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
506
669
  */
@@ -521,11 +684,13 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
521
684
  return transporter.request(request, requestOptions);
522
685
  },
523
686
  /**
524
- * Delete the records but leave settings and index-specific API keys untouched.
687
+ * Deletes only the records from an index while keeping settings, synonyms, and rules.
688
+ *
689
+ * Required API Key ACLs:
690
+ * - deleteIndex.
525
691
  *
526
- * @summary Delete all records from an index.
527
692
  * @param clearObjects - The clearObjects object.
528
- * @param clearObjects.indexName - Index on which to perform the request.
693
+ * @param clearObjects.indexName - Name of the index on which to perform the operation.
529
694
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
530
695
  */
531
696
  clearObjects({ indexName }, requestOptions) {
@@ -544,12 +709,14 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
544
709
  return transporter.request(request, requestOptions);
545
710
  },
546
711
  /**
547
- * Delete all rules in the index.
712
+ * Deletes all rules from the index.
713
+ *
714
+ * Required API Key ACLs:
715
+ * - editSettings.
548
716
  *
549
- * @summary Delete all rules.
550
717
  * @param clearRules - The clearRules object.
551
- * @param clearRules.indexName - Index on which to perform the request.
552
- * @param clearRules.forwardToReplicas - Indicates whether changed index settings are forwarded to the replica indices.
718
+ * @param clearRules.indexName - Name of the index on which to perform the operation.
719
+ * @param clearRules.forwardToReplicas - Whether changes are applied to replica indices.
553
720
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
554
721
  */
555
722
  clearRules({ indexName, forwardToReplicas }, requestOptions) {
@@ -571,12 +738,14 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
571
738
  return transporter.request(request, requestOptions);
572
739
  },
573
740
  /**
574
- * Delete all synonyms in the index.
741
+ * Deletes all synonyms from the index.
742
+ *
743
+ * Required API Key ACLs:
744
+ * - editSettings.
575
745
  *
576
- * @summary Delete all synonyms.
577
746
  * @param clearSynonyms - The clearSynonyms object.
578
- * @param clearSynonyms.indexName - Index on which to perform the request.
579
- * @param clearSynonyms.forwardToReplicas - Indicates whether changed index settings are forwarded to the replica indices.
747
+ * @param clearSynonyms.indexName - Name of the index on which to perform the operation.
748
+ * @param clearSynonyms.forwardToReplicas - Whether changes are applied to replica indices.
580
749
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
581
750
  */
582
751
  clearSynonyms({ indexName, forwardToReplicas }, requestOptions) {
@@ -600,7 +769,6 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
600
769
  /**
601
770
  * This method allow you to send requests to the Algolia REST API.
602
771
  *
603
- * @summary Send requests to the Algolia REST API.
604
772
  * @param customDelete - The customDelete object.
605
773
  * @param customDelete.path - Path of the endpoint, anything after \"/1\" must be specified.
606
774
  * @param customDelete.parameters - Query parameters to apply to the current query.
@@ -610,7 +778,7 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
610
778
  if (!path) {
611
779
  throw new Error('Parameter `path` is required when calling `customDelete`.');
612
780
  }
613
- const requestPath = '/1{path}'.replace('{path}', path);
781
+ const requestPath = '/{path}'.replace('{path}', path);
614
782
  const headers = {};
615
783
  const queryParameters = parameters ? parameters : {};
616
784
  const request = {
@@ -624,7 +792,6 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
624
792
  /**
625
793
  * This method allow you to send requests to the Algolia REST API.
626
794
  *
627
- * @summary Send requests to the Algolia REST API.
628
795
  * @param customGet - The customGet object.
629
796
  * @param customGet.path - Path of the endpoint, anything after \"/1\" must be specified.
630
797
  * @param customGet.parameters - Query parameters to apply to the current query.
@@ -634,7 +801,7 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
634
801
  if (!path) {
635
802
  throw new Error('Parameter `path` is required when calling `customGet`.');
636
803
  }
637
- const requestPath = '/1{path}'.replace('{path}', path);
804
+ const requestPath = '/{path}'.replace('{path}', path);
638
805
  const headers = {};
639
806
  const queryParameters = parameters ? parameters : {};
640
807
  const request = {
@@ -648,7 +815,6 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
648
815
  /**
649
816
  * This method allow you to send requests to the Algolia REST API.
650
817
  *
651
- * @summary Send requests to the Algolia REST API.
652
818
  * @param customPost - The customPost object.
653
819
  * @param customPost.path - Path of the endpoint, anything after \"/1\" must be specified.
654
820
  * @param customPost.parameters - Query parameters to apply to the current query.
@@ -659,7 +825,7 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
659
825
  if (!path) {
660
826
  throw new Error('Parameter `path` is required when calling `customPost`.');
661
827
  }
662
- const requestPath = '/1{path}'.replace('{path}', path);
828
+ const requestPath = '/{path}'.replace('{path}', path);
663
829
  const headers = {};
664
830
  const queryParameters = parameters ? parameters : {};
665
831
  const request = {
@@ -674,7 +840,6 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
674
840
  /**
675
841
  * This method allow you to send requests to the Algolia REST API.
676
842
  *
677
- * @summary Send requests to the Algolia REST API.
678
843
  * @param customPut - The customPut object.
679
844
  * @param customPut.path - Path of the endpoint, anything after \"/1\" must be specified.
680
845
  * @param customPut.parameters - Query parameters to apply to the current query.
@@ -685,7 +850,7 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
685
850
  if (!path) {
686
851
  throw new Error('Parameter `path` is required when calling `customPut`.');
687
852
  }
688
- const requestPath = '/1{path}'.replace('{path}', path);
853
+ const requestPath = '/{path}'.replace('{path}', path);
689
854
  const headers = {};
690
855
  const queryParameters = parameters ? parameters : {};
691
856
  const request = {
@@ -698,9 +863,11 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
698
863
  return transporter.request(request, requestOptions);
699
864
  },
700
865
  /**
701
- * Delete an existing API key. The request must be authenticated with the admin API key.
866
+ * Deletes the API key.
867
+ *
868
+ * Required API Key ACLs:
869
+ * - admin.
702
870
  *
703
- * @summary Delete API key.
704
871
  * @param deleteApiKey - The deleteApiKey object.
705
872
  * @param deleteApiKey.key - API key.
706
873
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
@@ -721,11 +888,13 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
721
888
  return transporter.request(request, requestOptions);
722
889
  },
723
890
  /**
724
- * This operation doesn\'t support all the query options, only its filters (numeric, facet, or tag) and geo queries. It doesn\'t accept empty filters or queries.
891
+ * This operation doesn\'t accept empty queries or filters. It\'s more efficient to get a list of object IDs with the [`browse` operation](#tag/Search/operation/browse), and then delete the records using the [`batch` operation](tag/Records/operation/batch).
892
+ *
893
+ * Required API Key ACLs:
894
+ * - deleteIndex.
725
895
  *
726
- * @summary Delete all records matching a query.
727
896
  * @param deleteBy - The deleteBy object.
728
- * @param deleteBy.indexName - Index on which to perform the request.
897
+ * @param deleteBy.indexName - Name of the index on which to perform the operation.
729
898
  * @param deleteBy.deleteByParams - The deleteByParams object.
730
899
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
731
900
  */
@@ -749,11 +918,13 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
749
918
  return transporter.request(request, requestOptions);
750
919
  },
751
920
  /**
752
- * Delete an existing index.
921
+ * Deletes an index and all its settings. - Deleting an index doesn\'t delete its analytics data. - If you try to delete a non-existing index, the operation is ignored without warning. - If the index you want to delete has replica indices, the replicas become independent indices. - If the index you want to delete is a replica index, you must first unlink it from its primary index before you can delete it. For more information, see [Delete replica indices](https://www.algolia.com/doc/guides/managing-results/refine-results/sorting/how-to/deleting-replicas/).
922
+ *
923
+ * Required API Key ACLs:
924
+ * - deleteIndex.
753
925
  *
754
- * @summary Delete index.
755
926
  * @param deleteIndex - The deleteIndex object.
756
- * @param deleteIndex.indexName - Index on which to perform the request.
927
+ * @param deleteIndex.indexName - Name of the index on which to perform the operation.
757
928
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
758
929
  */
759
930
  deleteIndex({ indexName }, requestOptions) {
@@ -772,12 +943,14 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
772
943
  return transporter.request(request, requestOptions);
773
944
  },
774
945
  /**
775
- * To delete a set of records matching a query, use the [`deleteByQuery` operation](#tag/Records/operation/deleteBy) instead.
946
+ * Deletes a record by its object ID. To delete more than one record, use the [`batch` operation](#tag/Records/operation/batch). To delete records matching a query, use the [`deleteByQuery` operation](#tag/Records/operation/deleteBy).
947
+ *
948
+ * Required API Key ACLs:
949
+ * - deleteObject.
776
950
  *
777
- * @summary Delete a record.
778
951
  * @param deleteObject - The deleteObject object.
779
- * @param deleteObject.indexName - Index on which to perform the request.
780
- * @param deleteObject.objectID - Unique record (object) identifier.
952
+ * @param deleteObject.indexName - Name of the index on which to perform the operation.
953
+ * @param deleteObject.objectID - Unique record identifier.
781
954
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
782
955
  */
783
956
  deleteObject({ indexName, objectID }, requestOptions) {
@@ -801,13 +974,15 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
801
974
  return transporter.request(request, requestOptions);
802
975
  },
803
976
  /**
804
- * Delete a rule by its `objectID`. To find the `objectID` for rules, use the [`search` operation](#tag/Rules/operation/searchRules).
977
+ * Deletes a rule by its ID. To find the object ID for rules, use the [`search` operation](#tag/Rules/operation/searchRules).
978
+ *
979
+ * Required API Key ACLs:
980
+ * - editSettings.
805
981
  *
806
- * @summary Delete a rule.
807
982
  * @param deleteRule - The deleteRule object.
808
- * @param deleteRule.indexName - Index on which to perform the request.
983
+ * @param deleteRule.indexName - Name of the index on which to perform the operation.
809
984
  * @param deleteRule.objectID - Unique identifier of a rule object.
810
- * @param deleteRule.forwardToReplicas - Indicates whether changed index settings are forwarded to the replica indices.
985
+ * @param deleteRule.forwardToReplicas - Whether changes are applied to replica indices.
811
986
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
812
987
  */
813
988
  deleteRule({ indexName, objectID, forwardToReplicas }, requestOptions) {
@@ -834,9 +1009,11 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
834
1009
  return transporter.request(request, requestOptions);
835
1010
  },
836
1011
  /**
837
- * Remove a source from the list of allowed sources.
1012
+ * Deletes a source from the list of allowed sources.
1013
+ *
1014
+ * Required API Key ACLs:
1015
+ * - admin.
838
1016
  *
839
- * @summary Remove a source.
840
1017
  * @param deleteSource - The deleteSource object.
841
1018
  * @param deleteSource.source - IP address range of the source.
842
1019
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
@@ -857,13 +1034,15 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
857
1034
  return transporter.request(request, requestOptions);
858
1035
  },
859
1036
  /**
860
- * Delete a synonym by its `objectID`. To find the object IDs of your synonyms, use the [`search` operation](#tag/Synonyms/operation/searchSynonyms).
1037
+ * Deletes a synonym by its ID. To find the object IDs of your synonyms, use the [`search` operation](#tag/Synonyms/operation/searchSynonyms).
1038
+ *
1039
+ * Required API Key ACLs:
1040
+ * - editSettings.
861
1041
  *
862
- * @summary Delete a synonym.
863
1042
  * @param deleteSynonym - The deleteSynonym object.
864
- * @param deleteSynonym.indexName - Index on which to perform the request.
1043
+ * @param deleteSynonym.indexName - Name of the index on which to perform the operation.
865
1044
  * @param deleteSynonym.objectID - Unique identifier of a synonym object.
866
- * @param deleteSynonym.forwardToReplicas - Indicates whether changed index settings are forwarded to the replica indices.
1045
+ * @param deleteSynonym.forwardToReplicas - Whether changes are applied to replica indices.
867
1046
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
868
1047
  */
869
1048
  deleteSynonym({ indexName, objectID, forwardToReplicas }, requestOptions) {
@@ -890,9 +1069,8 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
890
1069
  return transporter.request(request, requestOptions);
891
1070
  },
892
1071
  /**
893
- * Get the permissions and restrictions of a specific API key. When authenticating with the admin API key, you can request information for any of your application\'s keys. When authenticating with other API keys, you can only retrieve information for that key.
1072
+ * Gets the permissions and restrictions of an API key. When authenticating with the admin API key, you can request information for any of your application\'s keys. When authenticating with other API keys, you can only retrieve information for that key.
894
1073
  *
895
- * @summary Get API key permissions.
896
1074
  * @param getApiKey - The getApiKey object.
897
1075
  * @param getApiKey.key - API key.
898
1076
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
@@ -913,9 +1091,36 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
913
1091
  return transporter.request(request, requestOptions);
914
1092
  },
915
1093
  /**
916
- * Lists Algolia\'s [supported languages](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/handling-natural-languages-nlp/in-depth/supported-languages/) and any customizations applied to each language\'s [stop word](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/handling-natural-languages-nlp/how-to/customize-stop-words/), [plural](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/handling-natural-languages-nlp/how-to/customize-plurals-and-other-declensions/), and [segmentation (compound)](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/handling-natural-languages-nlp/how-to/customize-segmentation/) features.
1094
+ * Checks the status of a given application task.
1095
+ *
1096
+ * Required API Key ACLs:
1097
+ * - editSettings.
1098
+ *
1099
+ * @param getAppTask - The getAppTask object.
1100
+ * @param getAppTask.taskID - Unique task identifier.
1101
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1102
+ */
1103
+ getAppTask({ taskID }, requestOptions) {
1104
+ if (!taskID) {
1105
+ throw new Error('Parameter `taskID` is required when calling `getAppTask`.');
1106
+ }
1107
+ const requestPath = '/1/task/{taskID}'.replace('{taskID}', encodeURIComponent(taskID));
1108
+ const headers = {};
1109
+ const queryParameters = {};
1110
+ const request = {
1111
+ method: 'GET',
1112
+ path: requestPath,
1113
+ queryParameters,
1114
+ headers,
1115
+ };
1116
+ return transporter.request(request, requestOptions);
1117
+ },
1118
+ /**
1119
+ * Lists supported languages with their supported dictionary types and number of custom entries.
1120
+ *
1121
+ * Required API Key ACLs:
1122
+ * - settings.
917
1123
  *
918
- * @summary List available languages.
919
1124
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
920
1125
  */
921
1126
  getDictionaryLanguages(requestOptions) {
@@ -931,9 +1136,11 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
931
1136
  return transporter.request(request, requestOptions);
932
1137
  },
933
1138
  /**
934
- * Get the languages for which [stop words are turned off](#tag/Dictionaries/operation/setDictionarySettings).
1139
+ * Retrieves the languages for which standard dictionary entries are turned off.
1140
+ *
1141
+ * Required API Key ACLs:
1142
+ * - settings.
935
1143
  *
936
- * @summary Get stop word settings.
937
1144
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
938
1145
  */
939
1146
  getDictionarySettings(requestOptions) {
@@ -949,14 +1156,16 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
949
1156
  return transporter.request(request, requestOptions);
950
1157
  },
951
1158
  /**
952
- * The request must be authenticated by an API key with the [`logs` ACL](https://www.algolia.com/doc/guides/security/api-keys/#access-control-list-acl). Logs are held for the last seven days. There\'s also a logging limit of 1,000 API calls per server. This request counts towards your [operations quota](https://support.algolia.com/hc/en-us/articles/4406981829777-How-does-Algolia-count-records-and-operations-) but doesn\'t appear in the logs itself. > **Note**: To fetch the logs for a Distributed Search Network (DSN) cluster, target the [DSN\'s endpoint](https://www.algolia.com/doc/guides/scaling/distributed-search-network-dsn/#accessing-dsn-servers).
1159
+ * The request must be authenticated by an API key with the [`logs` ACL](https://www.algolia.com/doc/guides/security/api-keys/#access-control-list-acl). - Logs are held for the last seven days. - Up to 1,000 API requests per server are logged. - This request counts towards your [operations quota](https://support.algolia.com/hc/en-us/articles/4406981829777-How-does-Algolia-count-records-and-operations-) but doesn\'t appear in the logs itself.
1160
+ *
1161
+ * Required API Key ACLs:
1162
+ * - logs.
953
1163
  *
954
- * @summary Return the latest log entries.
955
1164
  * @param getLogs - The getLogs object.
956
- * @param getLogs.offset - First log entry to retrieve. Sorted by decreasing date with 0 being the most recent.
1165
+ * @param getLogs.offset - First log entry to retrieve. The most recent entries are listed first.
957
1166
  * @param getLogs.length - Maximum number of entries to retrieve.
958
- * @param getLogs.indexName - Index for which log entries should be retrieved. When omitted, log entries are retrieved for all indices.
959
- * @param getLogs.type - Type of log entries to retrieve. When omitted, all log entries are retrieved.
1167
+ * @param getLogs.indexName - Index for which to retrieve log entries. By default, log entries are retrieved for all indices.
1168
+ * @param getLogs.type - Type of log entries to retrieve. By default, all log entries are retrieved.
960
1169
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
961
1170
  */
962
1171
  getLogs({ offset, length, indexName, type } = {}, requestOptions = undefined) {
@@ -984,13 +1193,15 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
984
1193
  return transporter.request(request, requestOptions);
985
1194
  },
986
1195
  /**
987
- * To get more than one record, use the [`objects` operation](#tag/Records/operation/getObjects).
1196
+ * Retrieves one record by its object ID. To retrieve more than one record, use the [`objects` operation](#tag/Records/operation/getObjects).
1197
+ *
1198
+ * Required API Key ACLs:
1199
+ * - search.
988
1200
  *
989
- * @summary Get a record.
990
1201
  * @param getObject - The getObject object.
991
- * @param getObject.indexName - Index on which to perform the request.
992
- * @param getObject.objectID - Unique record (object) identifier.
993
- * @param getObject.attributesToRetrieve - Attributes to include with the records in the response. This is useful to reduce the size of the API response. By default, all retrievable attributes are returned. `objectID` is always retrieved, even when not specified. [`unretrievableAttributes`](https://www.algolia.com/doc/api-reference/api-parameters/unretrievableAttributes/) won\'t be retrieved unless the request is authenticated with the admin API key.
1202
+ * @param getObject.indexName - Name of the index on which to perform the operation.
1203
+ * @param getObject.objectID - Unique record identifier.
1204
+ * @param getObject.attributesToRetrieve - Attributes to include with the records in the response. This is useful to reduce the size of the API response. By default, all retrievable attributes are returned. `objectID` is always retrieved. Attributes included in `unretrievableAttributes` won\'t be retrieved unless the request is authenticated with the admin API key.
994
1205
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
995
1206
  */
996
1207
  getObject({ indexName, objectID, attributesToRetrieve }, requestOptions) {
@@ -1017,9 +1228,11 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
1017
1228
  return transporter.request(request, requestOptions);
1018
1229
  },
1019
1230
  /**
1020
- * Retrieve one or more records, potentially from different indices, in a single API operation. Results will be received in the same order as the requests.
1231
+ * Retrieves one or more records, potentially from different indices. Records are returned in the same order as the requests.
1232
+ *
1233
+ * Required API Key ACLs:
1234
+ * - search.
1021
1235
  *
1022
- * @summary Get multiple records.
1023
1236
  * @param getObjectsParams - Request object.
1024
1237
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1025
1238
  */
@@ -1045,11 +1258,13 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
1045
1258
  return transporter.request(request, requestOptions);
1046
1259
  },
1047
1260
  /**
1048
- * Get a rule by its `objectID`. To find the `objectID` for rules, use the [`search` operation](#tag/Rules/operation/searchRules).
1261
+ * Retrieves a rule by its ID. To find the object ID of rules, use the [`search` operation](#tag/Rules/operation/searchRules).
1262
+ *
1263
+ * Required API Key ACLs:
1264
+ * - settings.
1049
1265
  *
1050
- * @summary Get a rule.
1051
1266
  * @param getRule - The getRule object.
1052
- * @param getRule.indexName - Index on which to perform the request.
1267
+ * @param getRule.indexName - Name of the index on which to perform the operation.
1053
1268
  * @param getRule.objectID - Unique identifier of a rule object.
1054
1269
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1055
1270
  */
@@ -1074,11 +1289,13 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
1074
1289
  return transporter.request(request, requestOptions);
1075
1290
  },
1076
1291
  /**
1077
- * Return an object containing an index\'s [configuration settings](https://www.algolia.com/doc/api-reference/settings-api-parameters/).
1292
+ * Retrieves an object with non-null index settings.
1293
+ *
1294
+ * Required API Key ACLs:
1295
+ * - search.
1078
1296
  *
1079
- * @summary Get index settings.
1080
1297
  * @param getSettings - The getSettings object.
1081
- * @param getSettings.indexName - Index on which to perform the request.
1298
+ * @param getSettings.indexName - Name of the index on which to perform the operation.
1082
1299
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1083
1300
  */
1084
1301
  getSettings({ indexName }, requestOptions) {
@@ -1097,9 +1314,11 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
1097
1314
  return transporter.request(request, requestOptions);
1098
1315
  },
1099
1316
  /**
1100
- * Get all allowed sources (IP addresses).
1317
+ * Retrieves all allowed IP addresses with access to your application.
1318
+ *
1319
+ * Required API Key ACLs:
1320
+ * - admin.
1101
1321
  *
1102
- * @summary Get all allowed IP addresses.
1103
1322
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1104
1323
  */
1105
1324
  getSources(requestOptions) {
@@ -1115,11 +1334,13 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
1115
1334
  return transporter.request(request, requestOptions);
1116
1335
  },
1117
1336
  /**
1118
- * Get a syonym by its `objectID`. To find the object IDs for your synonyms, use the [`search` operation](#tag/Synonyms/operation/searchSynonyms).
1337
+ * Retrieves a syonym by its ID. To find the object IDs for your synonyms, use the [`search` operation](#tag/Synonyms/operation/searchSynonyms).
1338
+ *
1339
+ * Required API Key ACLs:
1340
+ * - settings.
1119
1341
  *
1120
- * @summary Get a synonym object.
1121
1342
  * @param getSynonym - The getSynonym object.
1122
- * @param getSynonym.indexName - Index on which to perform the request.
1343
+ * @param getSynonym.indexName - Name of the index on which to perform the operation.
1123
1344
  * @param getSynonym.objectID - Unique identifier of a synonym object.
1124
1345
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1125
1346
  */
@@ -1144,11 +1365,13 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
1144
1365
  return transporter.request(request, requestOptions);
1145
1366
  },
1146
1367
  /**
1147
- * Some operations, such as copying an index, will respond with a `taskID` value. Use this value here to check the status of that task.
1368
+ * Checks the status of a given task. Indexing tasks are asynchronous. When you add, update, or delete records or indices, a task is created on a queue and completed depending on the load on the server. The indexing tasks\' responses include a task ID that you can use to check the status.
1369
+ *
1370
+ * Required API Key ACLs:
1371
+ * - addObject.
1148
1372
  *
1149
- * @summary Check a task\'s status.
1150
1373
  * @param getTask - The getTask object.
1151
- * @param getTask.indexName - Index on which to perform the request.
1374
+ * @param getTask.indexName - Name of the index on which to perform the operation.
1152
1375
  * @param getTask.taskID - Unique task identifier.
1153
1376
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1154
1377
  */
@@ -1173,9 +1396,11 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
1173
1396
  return transporter.request(request, requestOptions);
1174
1397
  },
1175
1398
  /**
1176
- * Get the IDs of the 10 users with the highest number of records per cluster. Since it can take up to a few seconds to get the data from the different clusters, the response isn\'t real-time.
1399
+ * Get the IDs of the 10 users with the highest number of records per cluster. Since it can take a few seconds to get the data from the different clusters, the response isn\'t real-time.
1400
+ *
1401
+ * Required API Key ACLs:
1402
+ * - admin.
1177
1403
  *
1178
- * @summary Get top userID.
1179
1404
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1180
1405
  */
1181
1406
  getTopUserIds(requestOptions) {
@@ -1191,11 +1416,13 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
1191
1416
  return transporter.request(request, requestOptions);
1192
1417
  },
1193
1418
  /**
1194
- * Returns the userID data stored in the mapping. Since it can take up to a few seconds to get the data from the different clusters, the response isn\'t real-time.
1419
+ * Returns the user ID data stored in the mapping. Since it can take a few seconds to get the data from the different clusters, the response isn\'t real-time.
1420
+ *
1421
+ * Required API Key ACLs:
1422
+ * - admin.
1195
1423
  *
1196
- * @summary Get userID.
1197
1424
  * @param getUserId - The getUserId object.
1198
- * @param getUserId.userID - UserID to assign.
1425
+ * @param getUserId.userID - Unique identifier of the user who makes the search request.
1199
1426
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1200
1427
  */
1201
1428
  getUserId({ userID }, requestOptions) {
@@ -1216,9 +1443,11 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
1216
1443
  /**
1217
1444
  * To determine when the time-consuming process of creating a large batch of users or migrating users from one cluster to another is complete, this operation retrieves the status of the process.
1218
1445
  *
1219
- * @summary Get migration and user mapping status.
1446
+ * Required API Key ACLs:
1447
+ * - admin.
1448
+ *
1220
1449
  * @param hasPendingMappings - The hasPendingMappings object.
1221
- * @param hasPendingMappings.getClusters - Indicates whether to include the cluster\'s pending mapping state in the response.
1450
+ * @param hasPendingMappings.getClusters - Whether to include the cluster\'s pending mapping state in the response.
1222
1451
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1223
1452
  */
1224
1453
  hasPendingMappings({ getClusters } = {}, requestOptions = undefined) {
@@ -1237,9 +1466,11 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
1237
1466
  return transporter.request(request, requestOptions);
1238
1467
  },
1239
1468
  /**
1240
- * List all API keys associated with your Algolia application, including their permissions and restrictions.
1469
+ * Lists all API keys associated with your Algolia application, including their permissions and restrictions.
1470
+ *
1471
+ * Required API Key ACLs:
1472
+ * - admin.
1241
1473
  *
1242
- * @summary List API keys.
1243
1474
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1244
1475
  */
1245
1476
  listApiKeys(requestOptions) {
@@ -1255,9 +1486,11 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
1255
1486
  return transporter.request(request, requestOptions);
1256
1487
  },
1257
1488
  /**
1258
- * List the available clusters in a multi-cluster setup.
1489
+ * Lists the available clusters in a multi-cluster setup.
1490
+ *
1491
+ * Required API Key ACLs:
1492
+ * - admin.
1259
1493
  *
1260
- * @summary List clusters.
1261
1494
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1262
1495
  */
1263
1496
  listClusters(requestOptions) {
@@ -1273,12 +1506,14 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
1273
1506
  return transporter.request(request, requestOptions);
1274
1507
  },
1275
1508
  /**
1276
- * List indices in an Algolia application.
1509
+ * Lists all indices in the current Algolia application. The request follows any index restrictions of the API key you use to make the request.
1510
+ *
1511
+ * Required API Key ACLs:
1512
+ * - listIndexes.
1277
1513
  *
1278
- * @summary List indices.
1279
1514
  * @param listIndices - The listIndices object.
1280
- * @param listIndices.page - Returns the requested page number. The page size is determined by the `hitsPerPage` parameter. You can see the number of available pages in the `nbPages` response attribute. When `page` is null, the API response is not paginated.
1281
- * @param listIndices.hitsPerPage - Maximum number of hits per page.
1515
+ * @param listIndices.page - Requested page of the API response. If `null`, the API response is not paginated.
1516
+ * @param listIndices.hitsPerPage - Number of hits per page.
1282
1517
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1283
1518
  */
1284
1519
  listIndices({ page, hitsPerPage } = {}, requestOptions = undefined) {
@@ -1300,12 +1535,14 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
1300
1535
  return transporter.request(request, requestOptions);
1301
1536
  },
1302
1537
  /**
1303
- * List the userIDs assigned to a multi-cluster application. Since it can take up to a few seconds to get the data from the different clusters, the response isn\'t real-time.
1538
+ * Lists the userIDs assigned to a multi-cluster application. Since it can take a few seconds to get the data from the different clusters, the response isn\'t real-time.
1539
+ *
1540
+ * Required API Key ACLs:
1541
+ * - admin.
1304
1542
  *
1305
- * @summary List userIDs.
1306
1543
  * @param listUserIds - The listUserIds object.
1307
- * @param listUserIds.page - Returns the requested page number. The page size is determined by the `hitsPerPage` parameter. You can see the number of available pages in the `nbPages` response attribute. When `page` is null, the API response is not paginated.
1308
- * @param listUserIds.hitsPerPage - Maximum number of hits per page.
1544
+ * @param listUserIds.page - Requested page of the API response. If `null`, the API response is not paginated.
1545
+ * @param listUserIds.hitsPerPage - Number of hits per page.
1309
1546
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1310
1547
  */
1311
1548
  listUserIds({ page, hitsPerPage } = {}, requestOptions = undefined) {
@@ -1327,9 +1564,8 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
1327
1564
  return transporter.request(request, requestOptions);
1328
1565
  },
1329
1566
  /**
1330
- * To reduce the time spent on network round trips, you can perform several write actions in a single request. It\'s a multi-index version of the [`batch` operation](#tag/Records/operation/batch). Actions are applied in the order they are specified. The supported actions are equivalent to the individual operations of the same name.
1567
+ * Adds, updates, or deletes records in multiple indices with a single API request. - Actions are applied in the order they are specified. - Actions are equivalent to the individual API requests of the same name.
1331
1568
  *
1332
- * @summary Batch write operations on multiple indices.
1333
1569
  * @param batchParams - The batchParams object.
1334
1570
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1335
1571
  */
@@ -1353,11 +1589,13 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
1353
1589
  return transporter.request(request, requestOptions);
1354
1590
  },
1355
1591
  /**
1356
- * This `operation`, _copy_ or _move_, will copy or move a source index\'s (`IndexName`) records, settings, synonyms, and rules to a `destination` index. If the destination index exists, it will be replaced, except for index-specific API keys and analytics data. If the destination index doesn\'t exist, it will be created. The choice between moving or copying an index depends on your needs. Choose: - **Move** to rename an index. - **Copy** to create a new index with the same records and configuration as an existing one. > **Note**: When considering copying or moving, be aware of the [rate limitations](https://www.algolia.com/doc/guides/scaling/algolia-service-limits/#application-record-and-index-limits) on these processes and the [impact on your analytics data](https://www.algolia.com/doc/guides/sending-and-managing-data/manage-indices-and-apps/manage-indices/concepts/indices-analytics/).
1592
+ * Copies or moves (renames) an index within the same Algolia application. - Existing destination indices are overwritten, except for their analytics data. - If the destination index doesn\'t exist yet, it\'ll be created. **Copy** - Copying a source index that doesn\'t exist creates a new index with 0 records and default settings. - The API keys of the source index are merged with the existing keys in the destination index. - You can\'t copy the `enableReRanking`, `mode`, and `replicas` settings. - You can\'t copy to a destination index that already has replicas. - Be aware of the [size limits](https://www.algolia.com/doc/guides/scaling/algolia-service-limits/#application-record-and-index-limits). - Related guide: [Copy indices](https://www.algolia.com/doc/guides/sending-and-managing-data/manage-indices-and-apps/manage-indices/how-to/copy-indices/) **Move** - Moving a source index that doesn\'t exist is ignored without returning an error. - When moving an index, the analytics data keep their original name and a new set of analytics data is started for the new name. To access the original analytics in the dashboard, create an index with the original name. - If the destination index has replicas, moving will overwrite the existing index and copy the data to the replica indices. - Related guide: [Move indices](https://www.algolia.com/doc/guides/sending-and-managing-data/manage-indices-and-apps/manage-indices/how-to/move-indices/).
1593
+ *
1594
+ * Required API Key ACLs:
1595
+ * - addObject.
1357
1596
  *
1358
- * @summary Copy, move, or rename an index.
1359
1597
  * @param operationIndex - The operationIndex object.
1360
- * @param operationIndex.indexName - Index on which to perform the request.
1598
+ * @param operationIndex.indexName - Name of the index on which to perform the operation.
1361
1599
  * @param operationIndex.operationIndexParams - The operationIndexParams object.
1362
1600
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1363
1601
  */
@@ -1387,14 +1625,16 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
1387
1625
  return transporter.request(request, requestOptions);
1388
1626
  },
1389
1627
  /**
1390
- * Add new attributes or update current ones in an existing record. You can use any first-level attribute but not nested attributes. If you specify a [nested attribute](https://www.algolia.com/doc/guides/sending-and-managing-data/prepare-your-data/how-to/creating-and-using-nested-attributes/), the engine treats it as a replacement for its first-level ancestor.
1628
+ * Adds new attributes to a record, or update existing ones. - If a record with the specified object ID doesn\'t exist, a new record is added to the index **if** `createIfNotExists` is true. - If the index doesn\'t exist yet, this method creates a new index. - You can use any first-level attribute but not nested attributes. If you specify a nested attribute, the engine treats it as a replacement for its first-level ancestor.
1629
+ *
1630
+ * Required API Key ACLs:
1631
+ * - addObject.
1391
1632
  *
1392
- * @summary Update record attributes.
1393
1633
  * @param partialUpdateObject - The partialUpdateObject object.
1394
- * @param partialUpdateObject.indexName - Index on which to perform the request.
1395
- * @param partialUpdateObject.objectID - Unique record (object) identifier.
1396
- * @param partialUpdateObject.attributesToUpdate - Object with attributes to update.
1397
- * @param partialUpdateObject.createIfNotExists - Indicates whether to create a new record if it doesn\'t exist yet.
1634
+ * @param partialUpdateObject.indexName - Name of the index on which to perform the operation.
1635
+ * @param partialUpdateObject.objectID - Unique record identifier.
1636
+ * @param partialUpdateObject.attributesToUpdate - Attributes with their values.
1637
+ * @param partialUpdateObject.createIfNotExists - Whether to create a new record if it doesn\'t exist.
1398
1638
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1399
1639
  */
1400
1640
  partialUpdateObject({ indexName, objectID, attributesToUpdate, createIfNotExists, }, requestOptions) {
@@ -1425,11 +1665,13 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
1425
1665
  return transporter.request(request, requestOptions);
1426
1666
  },
1427
1667
  /**
1428
- * Remove a userID and its associated data from the multi-clusters.
1668
+ * Deletes a user ID and its associated data from the clusters.
1669
+ *
1670
+ * Required API Key ACLs:
1671
+ * - admin.
1429
1672
  *
1430
- * @summary Remove userID.
1431
1673
  * @param removeUserId - The removeUserId object.
1432
- * @param removeUserId.userID - UserID to assign.
1674
+ * @param removeUserId.userID - Unique identifier of the user who makes the search request.
1433
1675
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1434
1676
  */
1435
1677
  removeUserId({ userID }, requestOptions) {
@@ -1448,9 +1690,11 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
1448
1690
  return transporter.request(request, requestOptions);
1449
1691
  },
1450
1692
  /**
1451
- * Replace all allowed sources.
1693
+ * Replaces the list of allowed sources.
1694
+ *
1695
+ * Required API Key ACLs:
1696
+ * - admin.
1452
1697
  *
1453
- * @summary Replace all sources.
1454
1698
  * @param replaceSources - The replaceSources object.
1455
1699
  * @param replaceSources.source - Allowed sources.
1456
1700
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
@@ -1472,9 +1716,11 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
1472
1716
  return transporter.request(request, requestOptions);
1473
1717
  },
1474
1718
  /**
1475
- * Restore a deleted API key, along with its associated permissions. The request must be authenticated with the admin API key.
1719
+ * Restores a deleted API key. Restoring resets the `validity` attribute to `0`. Algolia stores up to 1,000 API keys per application. If you create more, the oldest API keys are deleted and can\'t be restored.
1720
+ *
1721
+ * Required API Key ACLs:
1722
+ * - admin.
1476
1723
  *
1477
- * @summary Restore API key.
1478
1724
  * @param restoreApiKey - The restoreApiKey object.
1479
1725
  * @param restoreApiKey.key - API key.
1480
1726
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
@@ -1495,12 +1741,14 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
1495
1741
  return transporter.request(request, requestOptions);
1496
1742
  },
1497
1743
  /**
1498
- * Add a record (object) to an index or replace it. If the record doesn\'t contain an `objectID`, Algolia automatically adds it. If you use an existing `objectID`, the existing record is replaced with the new one. To add multiple records to your index in a single API request, use the [`batch` operation](#tag/Records/operation/batch).
1744
+ * Adds a record to an index or replace it. - If the record doesn\'t have an object ID, a new record with an auto-generated object ID is added to your index. - If a record with the specified object ID exists, the existing record is replaced. - If a record with the specified object ID doesn\'t exist, a new record is added to your index. - If you add a record to an index that doesn\'t exist yet, a new index is created. To update _some_ attributes of a record, use the [`partial` operation](#tag/Records/operation/partial). To add, update, or replace multiple records, use the [`batch` operation](#tag/Records/operation/batch).
1745
+ *
1746
+ * Required API Key ACLs:
1747
+ * - addObject.
1499
1748
  *
1500
- * @summary Add or update a record.
1501
1749
  * @param saveObject - The saveObject object.
1502
- * @param saveObject.indexName - Index on which to perform the request.
1503
- * @param saveObject.body - The Algolia record.
1750
+ * @param saveObject.indexName - Name of the index on which to perform the operation.
1751
+ * @param saveObject.body - The record, a schemaless object with attributes that are useful in the context of search and discovery.
1504
1752
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1505
1753
  */
1506
1754
  saveObject({ indexName, body }, requestOptions) {
@@ -1523,14 +1771,16 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
1523
1771
  return transporter.request(request, requestOptions);
1524
1772
  },
1525
1773
  /**
1526
- * To create or update more than one rule, use the [`batch` operation](#tag/Rules/operation/saveRules).
1774
+ * If a rule with the specified object ID doesn\'t exist, it\'s created. Otherwise, the existing rule is replaced. To create or update more than one rule, use the [`batch` operation](#tag/Rules/operation/saveRules).
1775
+ *
1776
+ * Required API Key ACLs:
1777
+ * - editSettings.
1527
1778
  *
1528
- * @summary Create or update a rule.
1529
1779
  * @param saveRule - The saveRule object.
1530
- * @param saveRule.indexName - Index on which to perform the request.
1780
+ * @param saveRule.indexName - Name of the index on which to perform the operation.
1531
1781
  * @param saveRule.objectID - Unique identifier of a rule object.
1532
1782
  * @param saveRule.rule - The rule object.
1533
- * @param saveRule.forwardToReplicas - Indicates whether changed index settings are forwarded to the replica indices.
1783
+ * @param saveRule.forwardToReplicas - Whether changes are applied to replica indices.
1534
1784
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1535
1785
  */
1536
1786
  saveRule({ indexName, objectID, rule, forwardToReplicas }, requestOptions) {
@@ -1564,14 +1814,16 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
1564
1814
  return transporter.request(request, requestOptions);
1565
1815
  },
1566
1816
  /**
1567
- * Create or update multiple rules.
1817
+ * Create or update multiple rules. If a rule with the specified object ID doesn\'t exist, Algolia creates a new one. Otherwise, existing rules are replaced.
1818
+ *
1819
+ * Required API Key ACLs:
1820
+ * - editSettings.
1568
1821
  *
1569
- * @summary Save a batch of rules.
1570
1822
  * @param saveRules - The saveRules object.
1571
- * @param saveRules.indexName - Index on which to perform the request.
1823
+ * @param saveRules.indexName - Name of the index on which to perform the operation.
1572
1824
  * @param saveRules.rules - The rules object.
1573
- * @param saveRules.forwardToReplicas - Indicates whether changed index settings are forwarded to the replica indices.
1574
- * @param saveRules.clearExistingRules - Indicates whether existing rules should be deleted before adding this batch.
1825
+ * @param saveRules.forwardToReplicas - Whether changes are applied to replica indices.
1826
+ * @param saveRules.clearExistingRules - Whether existing rules should be deleted before adding this batch.
1575
1827
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1576
1828
  */
1577
1829
  saveRules({ indexName, rules, forwardToReplicas, clearExistingRules, }, requestOptions) {
@@ -1600,14 +1852,16 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
1600
1852
  return transporter.request(request, requestOptions);
1601
1853
  },
1602
1854
  /**
1603
- * Add a [synonym](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/adding-synonyms/#the-different-types-of-synonyms) to an index or replace it. If the synonym `objectID` doesn\'t exist, Algolia adds a new one. If you use an existing synonym `objectID`, the existing synonym is replaced with the new one. To add multiple synonyms in a single API request, use the [`batch` operation](#tag/Synonyms/operation/saveSynonyms).
1855
+ * If a synonym with the specified object ID doesn\'t exist, Algolia adds a new one. Otherwise, the existing synonym is replaced. To add multiple synonyms in a single API request, use the [`batch` operation](#tag/Synonyms/operation/saveSynonyms).
1856
+ *
1857
+ * Required API Key ACLs:
1858
+ * - editSettings.
1604
1859
  *
1605
- * @summary Save a synonym.
1606
1860
  * @param saveSynonym - The saveSynonym object.
1607
- * @param saveSynonym.indexName - Index on which to perform the request.
1861
+ * @param saveSynonym.indexName - Name of the index on which to perform the operation.
1608
1862
  * @param saveSynonym.objectID - Unique identifier of a synonym object.
1609
1863
  * @param saveSynonym.synonymHit - The synonymHit object.
1610
- * @param saveSynonym.forwardToReplicas - Indicates whether changed index settings are forwarded to the replica indices.
1864
+ * @param saveSynonym.forwardToReplicas - Whether changes are applied to replica indices.
1611
1865
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1612
1866
  */
1613
1867
  saveSynonym({ indexName, objectID, synonymHit, forwardToReplicas }, requestOptions) {
@@ -1644,14 +1898,16 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
1644
1898
  return transporter.request(request, requestOptions);
1645
1899
  },
1646
1900
  /**
1647
- * Create or update multiple synonyms.
1901
+ * If a synonym with the `objectID` doesn\'t exist, Algolia adds a new one. Otherwise, existing synonyms are replaced.
1902
+ *
1903
+ * Required API Key ACLs:
1904
+ * - editSettings.
1648
1905
  *
1649
- * @summary Save a batch of synonyms.
1650
1906
  * @param saveSynonyms - The saveSynonyms object.
1651
- * @param saveSynonyms.indexName - Index on which to perform the request.
1907
+ * @param saveSynonyms.indexName - Name of the index on which to perform the operation.
1652
1908
  * @param saveSynonyms.synonymHit - The synonymHit object.
1653
- * @param saveSynonyms.forwardToReplicas - Indicates whether changed index settings are forwarded to the replica indices.
1654
- * @param saveSynonyms.replaceExistingSynonyms - Indicates whether to replace all synonyms in the index with the ones sent with this request.
1909
+ * @param saveSynonyms.forwardToReplicas - Whether changes are applied to replica indices.
1910
+ * @param saveSynonyms.replaceExistingSynonyms - Whether to replace all synonyms in the index with the ones sent with this request.
1655
1911
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1656
1912
  */
1657
1913
  saveSynonyms({ indexName, synonymHit, forwardToReplicas, replaceExistingSynonyms, }, requestOptions) {
@@ -1681,10 +1937,12 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
1681
1937
  return transporter.request(request, requestOptions);
1682
1938
  },
1683
1939
  /**
1684
- * Send multiple search queries to one or more indices.
1940
+ * Sends multiple search request to one or more indices. This can be useful in these cases: - Different indices for different purposes, such as, one index for products, another one for marketing content. - Multiple searches to the same index—for example, with different filters.
1685
1941
  *
1686
- * @summary Search multiple indices.
1687
- * @param searchMethodParams - Query requests and strategies. Results will be received in the same order as the queries.
1942
+ * Required API Key ACLs:
1943
+ * - search.
1944
+ *
1945
+ * @param searchMethodParams - Muli-search request body. Results are returned in the same order as the requests.
1688
1946
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1689
1947
  */
1690
1948
  search(searchMethodParams, requestOptions) {
@@ -1731,11 +1989,13 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
1731
1989
  return transporter.request(request, requestOptions);
1732
1990
  },
1733
1991
  /**
1734
- * Search for standard and [custom](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/handling-natural-languages-nlp/how-to/customize-stop-words/) entries in the [stop words](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/handling-natural-languages-nlp/how-to/customize-stop-words/), [plurals](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/handling-natural-languages-nlp/how-to/customize-plurals-and-other-declensions/), or [segmentation (compounds)](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/handling-natural-languages-nlp/how-to/customize-segmentation/) dictionaries.
1992
+ * Searches for standard and custom dictionary entries.
1993
+ *
1994
+ * Required API Key ACLs:
1995
+ * - settings.
1735
1996
  *
1736
- * @summary Search dictionary entries.
1737
1997
  * @param searchDictionaryEntries - The searchDictionaryEntries object.
1738
- * @param searchDictionaryEntries.dictionaryName - Dictionary to search in.
1998
+ * @param searchDictionaryEntries.dictionaryName - Dictionary type in which to search.
1739
1999
  * @param searchDictionaryEntries.searchDictionaryEntriesParams - The searchDictionaryEntriesParams object.
1740
2000
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1741
2001
  */
@@ -1764,12 +2024,14 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
1764
2024
  return transporter.request(request, requestOptions);
1765
2025
  },
1766
2026
  /**
1767
- * [Search for a facet\'s values](https://www.algolia.com/doc/guides/managing-results/refine-results/faceting/#search-for-facet-values), optionally restricting the returned values to those contained in records matching other search criteria. > **Note**: Pagination isn\'t supported (`page` and `hitsPerPage` are ignored). By default, the engine returns a maximum of 10 values but you can adjust this with `maxFacetHits`.
2027
+ * Searches for values of a specified facet attribute. - By default, facet values are sorted by decreasing count. You can adjust this with the `sortFacetValueBy` parameter. - Searching for facet values doesn\'t work if you have **more than 65 searchable facets and searchable attributes combined**.
2028
+ *
2029
+ * Required API Key ACLs:
2030
+ * - search.
1768
2031
  *
1769
- * @summary Search for facet values.
1770
2032
  * @param searchForFacetValues - The searchForFacetValues object.
1771
- * @param searchForFacetValues.indexName - Index on which to perform the request.
1772
- * @param searchForFacetValues.facetName - Facet name.
2033
+ * @param searchForFacetValues.indexName - Name of the index on which to perform the operation.
2034
+ * @param searchForFacetValues.facetName - Facet attribute in which to search for values. This attribute must be included in the `attributesForFaceting` index setting with the `searchable()` modifier.
1773
2035
  * @param searchForFacetValues.searchForFacetValuesRequest - The searchForFacetValuesRequest object.
1774
2036
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1775
2037
  */
@@ -1797,11 +2059,13 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
1797
2059
  return transporter.request(request, requestOptions);
1798
2060
  },
1799
2061
  /**
1800
- * Search for rules in your index. You can control the search with parameters. To list all rules, send an empty request body.
2062
+ * Searches for rules in your index.
2063
+ *
2064
+ * Required API Key ACLs:
2065
+ * - settings.
1801
2066
  *
1802
- * @summary Search for rules.
1803
2067
  * @param searchRules - The searchRules object.
1804
- * @param searchRules.indexName - Index on which to perform the request.
2068
+ * @param searchRules.indexName - Name of the index on which to perform the operation.
1805
2069
  * @param searchRules.searchRulesParams - The searchRulesParams object.
1806
2070
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1807
2071
  */
@@ -1824,11 +2088,13 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
1824
2088
  return transporter.request(request, requestOptions);
1825
2089
  },
1826
2090
  /**
1827
- * Return records that match the query.
2091
+ * Searches a single index and return matching search results (_hits_). This method lets you retrieve up to 1,000 hits. If you need more, use the [`browse` operation](#tag/Search/operation/browse) or increase the `paginatedLimitedTo` index setting.
2092
+ *
2093
+ * Required API Key ACLs:
2094
+ * - search.
1828
2095
  *
1829
- * @summary Search an index.
1830
2096
  * @param searchSingleIndex - The searchSingleIndex object.
1831
- * @param searchSingleIndex.indexName - Index on which to perform the request.
2097
+ * @param searchSingleIndex.indexName - Name of the index on which to perform the operation.
1832
2098
  * @param searchSingleIndex.searchParams - The searchParams object.
1833
2099
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1834
2100
  */
@@ -1851,11 +2117,13 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
1851
2117
  return transporter.request(request, requestOptions);
1852
2118
  },
1853
2119
  /**
1854
- * Search for synonyms in your index. You can control and filter the search with parameters. To get all synonyms, send an empty request body.
2120
+ * Searches for synonyms in your index.
2121
+ *
2122
+ * Required API Key ACLs:
2123
+ * - settings.
1855
2124
  *
1856
- * @summary Search for synonyms.
1857
2125
  * @param searchSynonyms - The searchSynonyms object.
1858
- * @param searchSynonyms.indexName - Index on which to perform the request.
2126
+ * @param searchSynonyms.indexName - Name of the index on which to perform the operation.
1859
2127
  * @param searchSynonyms.searchSynonymsParams - Body of the `searchSynonyms` operation.
1860
2128
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1861
2129
  */
@@ -1878,9 +2146,11 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
1878
2146
  return transporter.request(request, requestOptions);
1879
2147
  },
1880
2148
  /**
1881
- * Since it can take up to a few seconds to get the data from the different clusters, the response isn\'t real-time. To ensure rapid updates, the user IDs index isn\'t built at the same time as the mapping. Instead, it\'s built every 12 hours, at the same time as the update of user ID usage. For example, if you add or move a user ID, the search will show an old value until the next time the mapping is rebuilt (every 12 hours).
2149
+ * Since it can take a few seconds to get the data from the different clusters, the response isn\'t real-time. To ensure rapid updates, the user IDs index isn\'t built at the same time as the mapping. Instead, it\'s built every 12 hours, at the same time as the update of user ID usage. For example, if you add or move a user ID, the search will show an old value until the next time the mapping is rebuilt (every 12 hours).
2150
+ *
2151
+ * Required API Key ACLs:
2152
+ * - admin.
1882
2153
  *
1883
- * @summary Search for a user ID.
1884
2154
  * @param searchUserIdsParams - The searchUserIdsParams object.
1885
2155
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1886
2156
  */
@@ -1906,9 +2176,11 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
1906
2176
  return transporter.request(request, requestOptions);
1907
2177
  },
1908
2178
  /**
1909
- * Set stop word settings for a specific language.
2179
+ * Turns standard stop word dictionary entries on or off for a given language.
2180
+ *
2181
+ * Required API Key ACLs:
2182
+ * - editSettings.
1910
2183
  *
1911
- * @summary Set stop word settings.
1912
2184
  * @param dictionarySettingsParams - The dictionarySettingsParams object.
1913
2185
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1914
2186
  */
@@ -1932,13 +2204,15 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
1932
2204
  return transporter.request(request, requestOptions);
1933
2205
  },
1934
2206
  /**
1935
- * Update the specified [index settings](https://www.algolia.com/doc/api-reference/settings-api-parameters/). Specifying null for a setting resets it to its default value.
2207
+ * Update the specified index settings. Index settings that you don\'t specify are left unchanged. Specify `null` to reset a setting to its default value. For best performance, update the index settings before you add new records to your index.
2208
+ *
2209
+ * Required API Key ACLs:
2210
+ * - editSettings.
1936
2211
  *
1937
- * @summary Update index settings.
1938
2212
  * @param setSettings - The setSettings object.
1939
- * @param setSettings.indexName - Index on which to perform the request.
2213
+ * @param setSettings.indexName - Name of the index on which to perform the operation.
1940
2214
  * @param setSettings.indexSettings - The indexSettings object.
1941
- * @param setSettings.forwardToReplicas - Indicates whether changed index settings are forwarded to the replica indices.
2215
+ * @param setSettings.forwardToReplicas - Whether changes are applied to replica indices.
1942
2216
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1943
2217
  */
1944
2218
  setSettings({ indexName, indexSettings, forwardToReplicas }, requestOptions) {
@@ -1964,9 +2238,11 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
1964
2238
  return transporter.request(request, requestOptions);
1965
2239
  },
1966
2240
  /**
1967
- * Replace the permissions of an existing API key. Any unspecified parameter resets that permission to its default value. The request must be authenticated with the admin API key.
2241
+ * Replaces the permissions of an existing API key. Any unspecified attribute resets that attribute to its default value.
2242
+ *
2243
+ * Required API Key ACLs:
2244
+ * - admin.
1968
2245
  *
1969
- * @summary Update an API key.
1970
2246
  * @param updateApiKey - The updateApiKey object.
1971
2247
  * @param updateApiKey.key - API key.
1972
2248
  * @param updateApiKey.apiKey - The apiKey object.
@@ -1998,6 +2274,7 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
1998
2274
  }
1999
2275
 
2000
2276
  // 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.
2277
+ // eslint-disable-next-line @typescript-eslint/explicit-function-return-type
2001
2278
  function searchClient(appId, apiKey, options) {
2002
2279
  if (!appId || typeof appId !== 'string') {
2003
2280
  throw new Error('`appId` is missing.');
@@ -2005,21 +2282,69 @@ function searchClient(appId, apiKey, options) {
2005
2282
  if (!apiKey || typeof apiKey !== 'string') {
2006
2283
  throw new Error('`apiKey` is missing.');
2007
2284
  }
2008
- return createSearchClient({
2009
- appId,
2010
- apiKey,
2011
- timeouts: {
2012
- connect: clientCommon.DEFAULT_CONNECT_TIMEOUT_NODE,
2013
- read: clientCommon.DEFAULT_READ_TIMEOUT_NODE,
2014
- write: clientCommon.DEFAULT_WRITE_TIMEOUT_NODE,
2015
- },
2016
- requester: requesterNodeHttp.createHttpRequester(),
2017
- algoliaAgents: [{ segment: 'Node.js', version: process.versions.node }],
2018
- responsesCache: clientCommon.createNullCache(),
2019
- requestsCache: clientCommon.createNullCache(),
2020
- hostsCache: clientCommon.createMemoryCache(),
2021
- ...options,
2022
- });
2285
+ return {
2286
+ ...createSearchClient({
2287
+ appId,
2288
+ apiKey,
2289
+ timeouts: {
2290
+ connect: clientCommon.DEFAULT_CONNECT_TIMEOUT_NODE,
2291
+ read: clientCommon.DEFAULT_READ_TIMEOUT_NODE,
2292
+ write: clientCommon.DEFAULT_WRITE_TIMEOUT_NODE,
2293
+ },
2294
+ requester: requesterNodeHttp.createHttpRequester(),
2295
+ algoliaAgents: [{ segment: 'Node.js', version: process.versions.node }],
2296
+ responsesCache: clientCommon.createNullCache(),
2297
+ requestsCache: clientCommon.createNullCache(),
2298
+ hostsCache: clientCommon.createMemoryCache(),
2299
+ ...options,
2300
+ }),
2301
+ /**
2302
+ * Helper: Generates a secured API key based on the given `parentApiKey` and given `restrictions`.
2303
+ *
2304
+ * @summary Helper: Generates a secured API key based on the given `parentApiKey` and given `restrictions`.
2305
+ * @param generateSecuredApiKey - The `generateSecuredApiKey` object.
2306
+ * @param generateSecuredApiKey.parentApiKey - The base API key from which to generate the new secured one.
2307
+ * @param generateSecuredApiKey.restrictions - A set of properties defining the restrictions of the secured API key.
2308
+ */
2309
+ generateSecuredApiKey({ parentApiKey, restrictions = {}, }) {
2310
+ let mergedRestrictions = restrictions;
2311
+ if (restrictions.searchParams) {
2312
+ // merge searchParams with the root restrictions
2313
+ mergedRestrictions = {
2314
+ ...restrictions,
2315
+ ...restrictions.searchParams,
2316
+ };
2317
+ delete mergedRestrictions.searchParams;
2318
+ }
2319
+ mergedRestrictions = Object.keys(mergedRestrictions)
2320
+ .sort()
2321
+ .reduce((acc, key) => {
2322
+ // eslint-disable-next-line no-param-reassign
2323
+ acc[key] = mergedRestrictions[key];
2324
+ return acc;
2325
+ }, {});
2326
+ const queryParameters = clientCommon.serializeQueryParameters(mergedRestrictions);
2327
+ return Buffer.from(crypto.createHmac('sha256', parentApiKey)
2328
+ .update(queryParameters)
2329
+ .digest('hex') + queryParameters).toString('base64');
2330
+ },
2331
+ /**
2332
+ * Helper: Retrieves the remaining validity of the previous generated `securedApiKey`, the `ValidUntil` parameter must have been provided.
2333
+ *
2334
+ * @summary Helper: Retrieves the remaining validity of the previous generated `secured_api_key`, the `ValidUntil` parameter must have been provided.
2335
+ * @param getSecuredApiKeyRemainingValidity - The `getSecuredApiKeyRemainingValidity` object.
2336
+ * @param getSecuredApiKeyRemainingValidity.securedApiKey - The secured API key generated with the `generateSecuredApiKey` method.
2337
+ */
2338
+ getSecuredApiKeyRemainingValidity({ securedApiKey, }) {
2339
+ const decodedString = Buffer.from(securedApiKey, 'base64').toString('ascii');
2340
+ const regex = /validUntil=(\d+)/;
2341
+ const match = decodedString.match(regex);
2342
+ if (match === null) {
2343
+ throw new Error('validUntil not found in given secured api key.');
2344
+ }
2345
+ return parseInt(match[1], 10) - Math.round(new Date().getTime() / 1000);
2346
+ },
2347
+ };
2023
2348
  }
2024
2349
 
2025
2350
  exports.apiClientVersion = apiClientVersion;