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

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 (267) hide show
  1. package/dist/builds/browser.d.ts +86 -3
  2. package/dist/builds/browser.d.ts.map +1 -1
  3. package/dist/builds/node.d.ts +104 -3
  4. package/dist/builds/node.d.ts.map +1 -1
  5. package/dist/client-search.cjs +419 -219
  6. package/dist/client-search.esm.browser.js +376 -212
  7. package/dist/client-search.esm.node.js +420 -220
  8. package/dist/client-search.umd.js +2 -2
  9. package/dist/model/acl.d.ts +1 -1
  10. package/dist/model/action.d.ts +1 -1
  11. package/dist/model/addApiKeyResponse.d.ts +1 -1
  12. package/dist/model/anchoring.d.ts +1 -1
  13. package/dist/model/apiKey.d.ts +8 -8
  14. package/dist/model/apiKeyOperation.d.ts +2 -0
  15. package/dist/model/apiKeyOperation.d.ts.map +1 -0
  16. package/dist/model/aroundPrecision.d.ts +1 -1
  17. package/dist/model/aroundPrecisionFromValueInner.d.ts +9 -0
  18. package/dist/model/aroundPrecisionFromValueInner.d.ts.map +1 -1
  19. package/dist/model/aroundRadius.d.ts +1 -1
  20. package/dist/model/aroundRadiusAll.d.ts +3 -0
  21. package/dist/model/aroundRadiusAll.d.ts.map +1 -1
  22. package/dist/model/automaticFacetFilter.d.ts +4 -4
  23. package/dist/model/automaticFacetFilters.d.ts +1 -1
  24. package/dist/model/baseGetApiKeyResponse.d.ts +1 -1
  25. package/dist/model/baseIndexSettings.d.ts +22 -17
  26. package/dist/model/baseIndexSettings.d.ts.map +1 -1
  27. package/dist/model/baseSearchParamsWithoutQuery.d.ts +26 -29
  28. package/dist/model/baseSearchParamsWithoutQuery.d.ts.map +1 -1
  29. package/dist/model/baseSearchResponse.d.ts +10 -6
  30. package/dist/model/baseSearchResponse.d.ts.map +1 -1
  31. package/dist/model/batchDictionaryEntriesParams.d.ts +3 -3
  32. package/dist/model/batchResponse.d.ts +2 -2
  33. package/dist/model/builtInOperation.d.ts +2 -2
  34. package/dist/model/builtInOperationType.d.ts +1 -1
  35. package/dist/model/clientMethodProps.d.ts +124 -65
  36. package/dist/model/clientMethodProps.d.ts.map +1 -1
  37. package/dist/model/condition.d.ts +7 -3
  38. package/dist/model/condition.d.ts.map +1 -1
  39. package/dist/model/consequence.d.ts +5 -5
  40. package/dist/model/consequenceHide.d.ts +2 -2
  41. package/dist/model/consequenceQuery.d.ts +1 -1
  42. package/dist/model/consequenceQueryObject.d.ts +2 -2
  43. package/dist/model/createdAtResponse.d.ts +1 -1
  44. package/dist/model/cursor.d.ts +1 -1
  45. package/dist/model/deleteApiKeyResponse.d.ts +1 -1
  46. package/dist/model/deleteByParams.d.ts +4 -4
  47. package/dist/model/deleteSourceResponse.d.ts +1 -1
  48. package/dist/model/deletedAtResponse.d.ts +2 -2
  49. package/dist/model/dictionaryEntry.d.ts +6 -8
  50. package/dist/model/dictionaryEntry.d.ts.map +1 -1
  51. package/dist/model/dictionaryEntryState.d.ts +1 -1
  52. package/dist/model/dictionaryLanguage.d.ts +2 -2
  53. package/dist/model/dictionarySettingsParams.d.ts +1 -1
  54. package/dist/model/distinct.d.ts +1 -1
  55. package/dist/model/edit.d.ts +1 -1
  56. package/dist/model/exactOnSingleWordQuery.d.ts +1 -1
  57. package/dist/model/facetFilters.d.ts +2 -3
  58. package/dist/model/facetFilters.d.ts.map +1 -1
  59. package/dist/model/facetHits.d.ts +2 -2
  60. package/dist/model/facetOrdering.d.ts +2 -2
  61. package/dist/model/facets.d.ts +2 -2
  62. package/dist/model/fetchedIndex.d.ts +1 -1
  63. package/dist/model/getObjectsRequest.d.ts +3 -3
  64. package/dist/model/getObjectsResponse.d.ts +1 -1
  65. package/dist/model/hasPendingMappingsResponse.d.ts +1 -1
  66. package/dist/model/highlightResult.d.ts +1 -1
  67. package/dist/model/highlightResult.d.ts.map +1 -1
  68. package/dist/model/highlightResultOption.d.ts +3 -3
  69. package/dist/model/hit.d.ts +4 -4
  70. package/dist/model/ignorePlurals.d.ts +3 -2
  71. package/dist/model/ignorePlurals.d.ts.map +1 -1
  72. package/dist/model/index.d.ts +4 -1
  73. package/dist/model/index.d.ts.map +1 -1
  74. package/dist/model/indexSettings.d.ts +1 -1
  75. package/dist/model/indexSettingsAsSearchParams.d.ts +32 -35
  76. package/dist/model/indexSettingsAsSearchParams.d.ts.map +1 -1
  77. package/dist/model/log.d.ts +11 -11
  78. package/dist/model/logQuery.d.ts +1 -1
  79. package/dist/model/matchLevel.d.ts +1 -1
  80. package/dist/model/mode.d.ts +1 -1
  81. package/dist/model/multipleBatchRequest.d.ts +1 -1
  82. package/dist/model/multipleBatchResponse.d.ts +2 -2
  83. package/dist/model/numericFilters.d.ts +2 -3
  84. package/dist/model/numericFilters.d.ts.map +1 -1
  85. package/dist/model/operationIndexParams.d.ts +2 -2
  86. package/dist/model/operationType.d.ts +1 -1
  87. package/dist/model/optionalFilters.d.ts +2 -3
  88. package/dist/model/optionalFilters.d.ts.map +1 -1
  89. package/dist/model/params.d.ts +1 -1
  90. package/dist/model/promoteObjectID.d.ts +2 -2
  91. package/dist/model/promoteObjectIDs.d.ts +2 -2
  92. package/dist/model/queryType.d.ts +1 -1
  93. package/dist/model/rankingInfo.d.ts +10 -7
  94. package/dist/model/rankingInfo.d.ts.map +1 -1
  95. package/dist/model/reRankingApplyFilter.d.ts +2 -3
  96. package/dist/model/reRankingApplyFilter.d.ts.map +1 -1
  97. package/dist/model/removeStopWords.d.ts +3 -2
  98. package/dist/model/removeStopWords.d.ts.map +1 -1
  99. package/dist/model/removeUserIdResponse.d.ts +1 -1
  100. package/dist/model/removeWordsIfNoResults.d.ts +1 -1
  101. package/dist/model/renderingContent.d.ts +1 -1
  102. package/dist/model/replaceSourceResponse.d.ts +1 -1
  103. package/dist/model/rule.d.ts +5 -5
  104. package/dist/model/saveObjectResponse.d.ts +3 -3
  105. package/dist/model/saveSynonymResponse.d.ts +2 -2
  106. package/dist/model/searchDictionaryEntriesParams.d.ts +5 -7
  107. package/dist/model/searchDictionaryEntriesParams.d.ts.map +1 -1
  108. package/dist/model/searchDictionaryEntriesResponse.d.ts +20 -0
  109. package/dist/model/searchDictionaryEntriesResponse.d.ts.map +1 -0
  110. package/dist/model/searchForFacetValuesRequest.d.ts +1 -1
  111. package/dist/model/searchForFacetValuesResponse.d.ts +4 -1
  112. package/dist/model/searchForFacetValuesResponse.d.ts.map +1 -1
  113. package/dist/model/searchForFacetsOptions.d.ts +2 -2
  114. package/dist/model/searchForHitsOptions.d.ts +1 -1
  115. package/dist/model/searchHits.d.ts +6 -3
  116. package/dist/model/searchHits.d.ts.map +1 -1
  117. package/dist/model/searchParamsObject.d.ts +3 -0
  118. package/dist/model/searchParamsObject.d.ts.map +1 -1
  119. package/dist/model/searchParamsQuery.d.ts +1 -1
  120. package/dist/model/searchRulesParams.d.ts +4 -8
  121. package/dist/model/searchRulesParams.d.ts.map +1 -1
  122. package/dist/model/searchRulesResponse.d.ts +2 -2
  123. package/dist/model/searchStrategy.d.ts +1 -1
  124. package/dist/model/searchSynonymsParams.d.ts +2 -2
  125. package/dist/model/searchSynonymsResponse.d.ts +2 -2
  126. package/dist/model/searchUserIdsParams.d.ts +1 -1
  127. package/dist/model/searchUserIdsResponse.d.ts +3 -3
  128. package/dist/model/securedAPIKeyRestrictions.d.ts +25 -0
  129. package/dist/model/securedAPIKeyRestrictions.d.ts.map +1 -0
  130. package/dist/model/semanticSearch.d.ts +2 -2
  131. package/dist/model/snippetResult.d.ts +1 -1
  132. package/dist/model/snippetResult.d.ts.map +1 -1
  133. package/dist/model/snippetResultOption.d.ts +2 -2
  134. package/dist/model/sortRemainingBy.d.ts +1 -1
  135. package/dist/model/supportedLanguage.d.ts +5 -0
  136. package/dist/model/supportedLanguage.d.ts.map +1 -0
  137. package/dist/model/tagFilters.d.ts +2 -3
  138. package/dist/model/tagFilters.d.ts.map +1 -1
  139. package/dist/model/taskStatus.d.ts +1 -1
  140. package/dist/model/timeRange.d.ts +2 -2
  141. package/dist/model/typoTolerance.d.ts +1 -1
  142. package/dist/model/typoToleranceEnum.d.ts +3 -0
  143. package/dist/model/typoToleranceEnum.d.ts.map +1 -1
  144. package/dist/model/updateApiKeyResponse.d.ts +1 -1
  145. package/dist/model/updatedAtResponse.d.ts +2 -2
  146. package/dist/model/updatedAtWithObjectIdResponse.d.ts +3 -3
  147. package/dist/model/updatedRuleResponse.d.ts +3 -3
  148. package/dist/model/userHit.d.ts +1 -1
  149. package/dist/model/userId.d.ts +1 -1
  150. package/dist/model/value.d.ts +1 -1
  151. package/dist/src/searchClient.d.ts +324 -202
  152. package/dist/src/searchClient.d.ts.map +1 -1
  153. package/model/acl.ts +1 -1
  154. package/model/action.ts +1 -1
  155. package/model/addApiKeyResponse.ts +1 -1
  156. package/model/anchoring.ts +1 -1
  157. package/model/apiKey.ts +8 -8
  158. package/model/{mixedSearchFilters.ts → apiKeyOperation.ts} +1 -1
  159. package/model/aroundPrecision.ts +1 -1
  160. package/model/aroundPrecisionFromValueInner.ts +9 -0
  161. package/model/aroundRadius.ts +1 -1
  162. package/model/aroundRadiusAll.ts +3 -0
  163. package/model/automaticFacetFilter.ts +4 -4
  164. package/model/automaticFacetFilters.ts +1 -1
  165. package/model/baseGetApiKeyResponse.ts +1 -1
  166. package/model/baseIndexSettings.ts +24 -17
  167. package/model/baseSearchParamsWithoutQuery.ts +26 -30
  168. package/model/baseSearchResponse.ts +11 -6
  169. package/model/batchDictionaryEntriesParams.ts +3 -3
  170. package/model/batchResponse.ts +2 -2
  171. package/model/builtInOperation.ts +2 -2
  172. package/model/builtInOperationType.ts +1 -1
  173. package/model/clientMethodProps.ts +135 -65
  174. package/model/condition.ts +8 -3
  175. package/model/consequence.ts +5 -5
  176. package/model/consequenceHide.ts +2 -2
  177. package/model/consequenceQuery.ts +1 -1
  178. package/model/consequenceQueryObject.ts +2 -2
  179. package/model/createdAtResponse.ts +1 -1
  180. package/model/cursor.ts +1 -1
  181. package/model/deleteApiKeyResponse.ts +1 -1
  182. package/model/deleteByParams.ts +4 -4
  183. package/model/deleteSourceResponse.ts +1 -1
  184. package/model/deletedAtResponse.ts +2 -2
  185. package/model/dictionaryEntry.ts +6 -8
  186. package/model/dictionaryEntryState.ts +1 -1
  187. package/model/dictionaryLanguage.ts +2 -2
  188. package/model/dictionarySettingsParams.ts +1 -1
  189. package/model/distinct.ts +1 -1
  190. package/model/edit.ts +1 -1
  191. package/model/exactOnSingleWordQuery.ts +1 -1
  192. package/model/facetFilters.ts +2 -4
  193. package/model/facetHits.ts +2 -2
  194. package/model/facetOrdering.ts +2 -2
  195. package/model/facets.ts +2 -2
  196. package/model/fetchedIndex.ts +1 -1
  197. package/model/getObjectsRequest.ts +3 -3
  198. package/model/getObjectsResponse.ts +1 -1
  199. package/model/hasPendingMappingsResponse.ts +1 -1
  200. package/model/highlightResult.ts +1 -0
  201. package/model/highlightResultOption.ts +3 -3
  202. package/model/hit.ts +4 -4
  203. package/model/ignorePlurals.ts +4 -2
  204. package/model/index.ts +4 -1
  205. package/model/indexSettings.ts +1 -1
  206. package/model/indexSettingsAsSearchParams.ts +32 -36
  207. package/model/log.ts +11 -11
  208. package/model/logQuery.ts +1 -1
  209. package/model/matchLevel.ts +1 -1
  210. package/model/mode.ts +1 -1
  211. package/model/multipleBatchRequest.ts +1 -1
  212. package/model/multipleBatchResponse.ts +2 -2
  213. package/model/numericFilters.ts +2 -4
  214. package/model/operationIndexParams.ts +2 -2
  215. package/model/operationType.ts +1 -1
  216. package/model/optionalFilters.ts +2 -4
  217. package/model/params.ts +1 -1
  218. package/model/promoteObjectID.ts +2 -2
  219. package/model/promoteObjectIDs.ts +2 -2
  220. package/model/queryType.ts +1 -1
  221. package/model/rankingInfo.ts +10 -7
  222. package/model/reRankingApplyFilter.ts +2 -4
  223. package/model/removeStopWords.ts +4 -2
  224. package/model/removeUserIdResponse.ts +1 -1
  225. package/model/removeWordsIfNoResults.ts +1 -1
  226. package/model/renderingContent.ts +1 -1
  227. package/model/replaceSourceResponse.ts +1 -1
  228. package/model/rule.ts +5 -5
  229. package/model/saveObjectResponse.ts +3 -3
  230. package/model/saveSynonymResponse.ts +2 -2
  231. package/model/searchDictionaryEntriesParams.ts +6 -7
  232. package/model/searchDictionaryEntriesResponse.ts +25 -0
  233. package/model/searchForFacetValuesRequest.ts +1 -1
  234. package/model/searchForFacetValuesResponse.ts +4 -1
  235. package/model/searchForFacetsOptions.ts +2 -2
  236. package/model/searchForHitsOptions.ts +1 -1
  237. package/model/searchHits.ts +6 -3
  238. package/model/searchParamsObject.ts +3 -0
  239. package/model/searchParamsQuery.ts +1 -1
  240. package/model/searchRulesParams.ts +4 -9
  241. package/model/searchRulesResponse.ts +2 -2
  242. package/model/searchStrategy.ts +1 -1
  243. package/model/searchSynonymsParams.ts +2 -2
  244. package/model/searchSynonymsResponse.ts +2 -2
  245. package/model/searchUserIdsParams.ts +1 -1
  246. package/model/searchUserIdsResponse.ts +3 -3
  247. package/model/securedAPIKeyRestrictions.ts +32 -0
  248. package/model/semanticSearch.ts +2 -2
  249. package/model/snippetResult.ts +2 -1
  250. package/model/snippetResultOption.ts +2 -2
  251. package/model/sortRemainingBy.ts +1 -1
  252. package/model/supportedLanguage.ts +74 -0
  253. package/model/tagFilters.ts +2 -4
  254. package/model/taskStatus.ts +1 -1
  255. package/model/timeRange.ts +2 -2
  256. package/model/typoTolerance.ts +1 -1
  257. package/model/typoToleranceEnum.ts +3 -0
  258. package/model/updateApiKeyResponse.ts +1 -1
  259. package/model/updatedAtResponse.ts +2 -2
  260. package/model/updatedAtWithObjectIdResponse.ts +3 -3
  261. package/model/updatedRuleResponse.ts +3 -3
  262. package/model/userHit.ts +1 -1
  263. package/model/userId.ts +1 -1
  264. package/model/value.ts +1 -1
  265. package/package.json +7 -7
  266. package/dist/model/mixedSearchFilters.d.ts +0 -2
  267. 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.2';
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.
@@ -114,7 +115,7 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
114
115
  * Helper: Wait for an API key to be added, updated or deleted based on a given `operation`.
115
116
  *
116
117
  * @summary Helper method that waits for an API key task to be processed.
117
- * @param waitForApiKeyOptions - The waitForApiKeyOptions object.
118
+ * @param waitForApiKeyOptions - The `waitForApiKeyOptions` object.
118
119
  * @param waitForApiKeyOptions.operation - The `operation` that was done on a `key`.
119
120
  * @param waitForApiKeyOptions.key - The `key` that has been added, deleted or updated.
120
121
  * @param waitForApiKeyOptions.apiKey - Necessary to know if an `update` operation has been processed, compare fields of the response with it.
@@ -167,7 +168,7 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
167
168
  * Helper: Iterate on the `browse` method of the client to allow aggregating objects of an index.
168
169
  *
169
170
  * @summary Helper method that iterates on the `browse` method.
170
- * @param browseObjects - The browseObjects object.
171
+ * @param browseObjects - The `browseObjects` object.
171
172
  * @param browseObjects.indexName - The index in which to perform the request.
172
173
  * @param browseObjects.browseParams - The `browse` parameters.
173
174
  * @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 +194,11 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
193
194
  * Helper: Iterate on the `searchRules` method of the client to allow aggregating rules of an index.
194
195
  *
195
196
  * @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`.
197
+ * @param browseRules - The `browseRules` object.
198
+ * @param browseRules.indexName - The index in which to perform the request.
199
+ * @param browseRules.searchRulesParams - The `searchRules` method parameters.
200
+ * @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).
201
+ * @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
202
  * @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
203
  */
203
204
  browseRules({ indexName, searchRulesParams, ...browseRulesOptions }, requestOptions) {
@@ -225,11 +226,11 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
225
226
  * Helper: Iterate on the `searchSynonyms` method of the client to allow aggregating rules of an index.
226
227
  *
227
228
  * @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.
229
+ * @param browseSynonyms - The `browseSynonyms` object.
230
+ * @param browseSynonyms.indexName - The index in which to perform the request.
231
+ * @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).
232
+ * @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`.
233
+ * @param browseSynonyms.searchSynonymsParams - The `searchSynonyms` method parameters.
233
234
  * @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
235
  */
235
236
  browseSynonyms({ indexName, searchSynonymsParams, ...browseSynonymsOptions }, requestOptions) {
@@ -239,16 +240,16 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
239
240
  hitsPerPage: 1000,
240
241
  };
241
242
  return clientCommon.createIterablePromise({
242
- func: (previousResponse) => {
243
- return this.searchSynonyms({
243
+ func: (_) => {
244
+ const resp = this.searchSynonyms({
244
245
  indexName,
245
246
  searchSynonymsParams: {
246
247
  ...params,
247
- page: previousResponse
248
- ? previousResponse.page + 1
249
- : params.page,
248
+ page: params.page,
250
249
  },
251
250
  }, requestOptions);
251
+ params.page += 1;
252
+ return resp;
252
253
  },
253
254
  validate: (response) => response.nbHits < params.hitsPerPage,
254
255
  ...browseSynonymsOptions,
@@ -277,9 +278,76 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
277
278
  return this.search(searchMethodParams, requestOptions);
278
279
  },
279
280
  /**
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.
281
+ * Helper: Chunks the given `objects` list in subset of 1000 elements max in order to make it fit in `batch` requests.
282
+ *
283
+ * @summary Helper: Chunks the given `objects` list in subset of 1000 elements max in order to make it fit in `batch` requests.
284
+ * @param chunkedBatch - The `chunkedBatch` object.
285
+ * @param chunkedBatch.indexName - The `indexName` to replace `objects` in.
286
+ * @param chunkedBatch.objects - The array of `objects` to store in the given Algolia `indexName`.
287
+ * @param chunkedBatch.action - The `batch` `action` to perform on the given array of `objects`, defaults to `addObject`.
288
+ * @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.
289
+ * @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.
290
+ * @param requestOptions - The requestOptions to send along with the query, they will be forwarded to the `getTask` method and merged with the transporter requestOptions.
291
+ */
292
+ async chunkedBatch({ indexName, objects, action = 'addObject', waitForTasks, batchSize = 1000, }, requestOptions) {
293
+ let requests = [];
294
+ const responses = [];
295
+ for (const [i, obj] of objects.entries()) {
296
+ requests.push({ action, body: obj });
297
+ if (i % batchSize === 0) {
298
+ responses.push(await this.batch({ indexName, batchWriteParams: { requests } }, requestOptions));
299
+ requests = [];
300
+ }
301
+ }
302
+ if (waitForTasks) {
303
+ for (const resp of responses) {
304
+ await this.waitForTask({ indexName, taskID: resp.taskID });
305
+ }
306
+ }
307
+ return responses;
308
+ },
309
+ /**
310
+ * 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.
311
+ *
312
+ * @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.
313
+ * @param replaceAllObjects - The `replaceAllObjects` object.
314
+ * @param replaceAllObjects.indexName - The `indexName` to replace `objects` in.
315
+ * @param replaceAllObjects.objects - The array of `objects` to store in the given Algolia `indexName`.
316
+ * @param replaceAllObjects.batchSize - The size of the chunk of `objects`. The number of `batch` calls will be equal to `length(objects) / batchSize`. Defaults to 1000.
317
+ * @param requestOptions - The requestOptions to send along with the query, they will be forwarded to the `getTask` method and merged with the transporter requestOptions.
318
+ */
319
+ async replaceAllObjects({ indexName, objects, batchSize }, requestOptions) {
320
+ const randomSuffix = Math.random().toString(36).substring(7);
321
+ const tmpIndexName = `${indexName}_tmp_${randomSuffix}`;
322
+ const copyOperationResponse = await this.operationIndex({
323
+ indexName,
324
+ operationIndexParams: {
325
+ operation: 'copy',
326
+ destination: tmpIndexName,
327
+ scope: ['settings', 'rules', 'synonyms'],
328
+ },
329
+ }, requestOptions);
330
+ await this.waitForTask({
331
+ indexName,
332
+ taskID: copyOperationResponse.taskID,
333
+ });
334
+ const batchResponses = await this.chunkedBatch({ indexName: tmpIndexName, objects, waitForTasks: true, batchSize }, requestOptions);
335
+ const moveOperationResponse = await this.operationIndex({
336
+ indexName: tmpIndexName,
337
+ operationIndexParams: { operation: 'move', destination: indexName },
338
+ }, requestOptions);
339
+ await this.waitForTask({
340
+ indexName,
341
+ taskID: moveOperationResponse.taskID,
342
+ });
343
+ return { copyOperationResponse, batchResponses, moveOperationResponse };
344
+ },
345
+ /**
346
+ * Creates a new API key with specific permissions and restrictions.
347
+ *
348
+ * Required API Key ACLs:
349
+ * - admin.
281
350
  *
282
- * @summary Add API key.
283
351
  * @param apiKey - The apiKey object.
284
352
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
285
353
  */
@@ -303,13 +371,15 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
303
371
  return transporter.request(request, requestOptions);
304
372
  },
305
373
  /**
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).
374
+ * 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).
375
+ *
376
+ * Required API Key ACLs:
377
+ * - addObject.
307
378
  *
308
- * @summary Add or update a record (using objectID).
309
379
  * @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.
380
+ * @param addOrUpdateObject.indexName - Name of the index on which to perform the operation.
381
+ * @param addOrUpdateObject.objectID - Unique record identifier.
382
+ * @param addOrUpdateObject.body - The record, a schemaless object with attributes that are useful in the context of search and discovery.
313
383
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
314
384
  */
315
385
  addOrUpdateObject({ indexName, objectID, body }, requestOptions) {
@@ -337,9 +407,11 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
337
407
  return transporter.request(request, requestOptions);
338
408
  },
339
409
  /**
340
- * Add a source to the list of allowed sources.
410
+ * Adds a source to the list of allowed sources.
411
+ *
412
+ * Required API Key ACLs:
413
+ * - admin.
341
414
  *
342
- * @summary Add a source.
343
415
  * @param source - Source to add.
344
416
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
345
417
  */
@@ -363,11 +435,13 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
363
435
  return transporter.request(request, requestOptions);
364
436
  },
365
437
  /**
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.
438
+ * 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.
439
+ *
440
+ * Required API Key ACLs:
441
+ * - admin.
367
442
  *
368
- * @summary Assign or move a user ID.
369
443
  * @param assignUserId - The assignUserId object.
370
- * @param assignUserId.xAlgoliaUserID - UserID to assign.
444
+ * @param assignUserId.xAlgoliaUserID - Unique identifier of the user who makes the search request.
371
445
  * @param assignUserId.assignUserIdParams - The assignUserIdParams object.
372
446
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
373
447
  */
@@ -397,11 +471,10 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
397
471
  return transporter.request(request, requestOptions);
398
472
  },
399
473
  /**
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.
474
+ * 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
475
  *
402
- * @summary Batch write operations on one index.
403
476
  * @param batch - The batch object.
404
- * @param batch.indexName - Index on which to perform the request.
477
+ * @param batch.indexName - Name of the index on which to perform the operation.
405
478
  * @param batch.batchWriteParams - The batchWriteParams object.
406
479
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
407
480
  */
@@ -428,11 +501,13 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
428
501
  return transporter.request(request, requestOptions);
429
502
  },
430
503
  /**
431
- * Assign multiple user IDs to a cluster. **You can\'t _move_ users with this operation.**.
504
+ * Assigns multiple user IDs to a cluster. **You can\'t move users with this operation**.
505
+ *
506
+ * Required API Key ACLs:
507
+ * - admin.
432
508
  *
433
- * @summary Batch assign userIDs.
434
509
  * @param batchAssignUserIds - The batchAssignUserIds object.
435
- * @param batchAssignUserIds.xAlgoliaUserID - UserID to assign.
510
+ * @param batchAssignUserIds.xAlgoliaUserID - Unique identifier of the user who makes the search request.
436
511
  * @param batchAssignUserIds.batchAssignUserIdsParams - The batchAssignUserIdsParams object.
437
512
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
438
513
  */
@@ -465,11 +540,13 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
465
540
  return transporter.request(request, requestOptions);
466
541
  },
467
542
  /**
468
- * Add or remove a batch of dictionary entries.
543
+ * Adds or deletes multiple entries from your plurals, segmentation, or stop word dictionaries.
544
+ *
545
+ * Required API Key ACLs:
546
+ * - editSettings.
469
547
  *
470
- * @summary Batch dictionary entries.
471
548
  * @param batchDictionaryEntries - The batchDictionaryEntries object.
472
- * @param batchDictionaryEntries.dictionaryName - Dictionary to search in.
549
+ * @param batchDictionaryEntries.dictionaryName - Dictionary type in which to search.
473
550
  * @param batchDictionaryEntries.batchDictionaryEntriesParams - The batchDictionaryEntriesParams object.
474
551
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
475
552
  */
@@ -496,11 +573,13 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
496
573
  return transporter.request(request, requestOptions);
497
574
  },
498
575
  /**
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.
576
+ * 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. - Deduplication (`distinct`) is turned off. - There\'s no ranking for: typo-tolerance, number of matched words, proximity, geo distance.
577
+ *
578
+ * Required API Key ACLs:
579
+ * - browse.
500
580
  *
501
- * @summary Get all records from an index.
502
581
  * @param browse - The browse object.
503
- * @param browse.indexName - Index on which to perform the request.
582
+ * @param browse.indexName - Name of the index on which to perform the operation.
504
583
  * @param browse.browseParams - The browseParams object.
505
584
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
506
585
  */
@@ -521,11 +600,13 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
521
600
  return transporter.request(request, requestOptions);
522
601
  },
523
602
  /**
524
- * Delete the records but leave settings and index-specific API keys untouched.
603
+ * Deletes only the records from an index while keeping settings, synonyms, and rules.
604
+ *
605
+ * Required API Key ACLs:
606
+ * - deleteIndex.
525
607
  *
526
- * @summary Delete all records from an index.
527
608
  * @param clearObjects - The clearObjects object.
528
- * @param clearObjects.indexName - Index on which to perform the request.
609
+ * @param clearObjects.indexName - Name of the index on which to perform the operation.
529
610
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
530
611
  */
531
612
  clearObjects({ indexName }, requestOptions) {
@@ -544,12 +625,14 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
544
625
  return transporter.request(request, requestOptions);
545
626
  },
546
627
  /**
547
- * Delete all rules in the index.
628
+ * Deletes all rules from the index.
629
+ *
630
+ * Required API Key ACLs:
631
+ * - editSettings.
548
632
  *
549
- * @summary Delete all rules.
550
633
  * @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.
634
+ * @param clearRules.indexName - Name of the index on which to perform the operation.
635
+ * @param clearRules.forwardToReplicas - Whether changes are applied to replica indices.
553
636
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
554
637
  */
555
638
  clearRules({ indexName, forwardToReplicas }, requestOptions) {
@@ -571,12 +654,14 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
571
654
  return transporter.request(request, requestOptions);
572
655
  },
573
656
  /**
574
- * Delete all synonyms in the index.
657
+ * Deletes all synonyms from the index.
658
+ *
659
+ * Required API Key ACLs:
660
+ * - editSettings.
575
661
  *
576
- * @summary Delete all synonyms.
577
662
  * @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.
663
+ * @param clearSynonyms.indexName - Name of the index on which to perform the operation.
664
+ * @param clearSynonyms.forwardToReplicas - Whether changes are applied to replica indices.
580
665
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
581
666
  */
582
667
  clearSynonyms({ indexName, forwardToReplicas }, requestOptions) {
@@ -600,7 +685,6 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
600
685
  /**
601
686
  * This method allow you to send requests to the Algolia REST API.
602
687
  *
603
- * @summary Send requests to the Algolia REST API.
604
688
  * @param customDelete - The customDelete object.
605
689
  * @param customDelete.path - Path of the endpoint, anything after \"/1\" must be specified.
606
690
  * @param customDelete.parameters - Query parameters to apply to the current query.
@@ -610,7 +694,7 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
610
694
  if (!path) {
611
695
  throw new Error('Parameter `path` is required when calling `customDelete`.');
612
696
  }
613
- const requestPath = '/1{path}'.replace('{path}', path);
697
+ const requestPath = '/{path}'.replace('{path}', path);
614
698
  const headers = {};
615
699
  const queryParameters = parameters ? parameters : {};
616
700
  const request = {
@@ -624,7 +708,6 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
624
708
  /**
625
709
  * This method allow you to send requests to the Algolia REST API.
626
710
  *
627
- * @summary Send requests to the Algolia REST API.
628
711
  * @param customGet - The customGet object.
629
712
  * @param customGet.path - Path of the endpoint, anything after \"/1\" must be specified.
630
713
  * @param customGet.parameters - Query parameters to apply to the current query.
@@ -634,7 +717,7 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
634
717
  if (!path) {
635
718
  throw new Error('Parameter `path` is required when calling `customGet`.');
636
719
  }
637
- const requestPath = '/1{path}'.replace('{path}', path);
720
+ const requestPath = '/{path}'.replace('{path}', path);
638
721
  const headers = {};
639
722
  const queryParameters = parameters ? parameters : {};
640
723
  const request = {
@@ -648,7 +731,6 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
648
731
  /**
649
732
  * This method allow you to send requests to the Algolia REST API.
650
733
  *
651
- * @summary Send requests to the Algolia REST API.
652
734
  * @param customPost - The customPost object.
653
735
  * @param customPost.path - Path of the endpoint, anything after \"/1\" must be specified.
654
736
  * @param customPost.parameters - Query parameters to apply to the current query.
@@ -659,7 +741,7 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
659
741
  if (!path) {
660
742
  throw new Error('Parameter `path` is required when calling `customPost`.');
661
743
  }
662
- const requestPath = '/1{path}'.replace('{path}', path);
744
+ const requestPath = '/{path}'.replace('{path}', path);
663
745
  const headers = {};
664
746
  const queryParameters = parameters ? parameters : {};
665
747
  const request = {
@@ -674,7 +756,6 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
674
756
  /**
675
757
  * This method allow you to send requests to the Algolia REST API.
676
758
  *
677
- * @summary Send requests to the Algolia REST API.
678
759
  * @param customPut - The customPut object.
679
760
  * @param customPut.path - Path of the endpoint, anything after \"/1\" must be specified.
680
761
  * @param customPut.parameters - Query parameters to apply to the current query.
@@ -685,7 +766,7 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
685
766
  if (!path) {
686
767
  throw new Error('Parameter `path` is required when calling `customPut`.');
687
768
  }
688
- const requestPath = '/1{path}'.replace('{path}', path);
769
+ const requestPath = '/{path}'.replace('{path}', path);
689
770
  const headers = {};
690
771
  const queryParameters = parameters ? parameters : {};
691
772
  const request = {
@@ -698,9 +779,11 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
698
779
  return transporter.request(request, requestOptions);
699
780
  },
700
781
  /**
701
- * Delete an existing API key. The request must be authenticated with the admin API key.
782
+ * Deletes the API key.
783
+ *
784
+ * Required API Key ACLs:
785
+ * - admin.
702
786
  *
703
- * @summary Delete API key.
704
787
  * @param deleteApiKey - The deleteApiKey object.
705
788
  * @param deleteApiKey.key - API key.
706
789
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
@@ -721,11 +804,13 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
721
804
  return transporter.request(request, requestOptions);
722
805
  },
723
806
  /**
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.
807
+ * 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).
808
+ *
809
+ * Required API Key ACLs:
810
+ * - deleteIndex.
725
811
  *
726
- * @summary Delete all records matching a query.
727
812
  * @param deleteBy - The deleteBy object.
728
- * @param deleteBy.indexName - Index on which to perform the request.
813
+ * @param deleteBy.indexName - Name of the index on which to perform the operation.
729
814
  * @param deleteBy.deleteByParams - The deleteByParams object.
730
815
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
731
816
  */
@@ -749,11 +834,13 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
749
834
  return transporter.request(request, requestOptions);
750
835
  },
751
836
  /**
752
- * Delete an existing index.
837
+ * 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/).
838
+ *
839
+ * Required API Key ACLs:
840
+ * - deleteIndex.
753
841
  *
754
- * @summary Delete index.
755
842
  * @param deleteIndex - The deleteIndex object.
756
- * @param deleteIndex.indexName - Index on which to perform the request.
843
+ * @param deleteIndex.indexName - Name of the index on which to perform the operation.
757
844
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
758
845
  */
759
846
  deleteIndex({ indexName }, requestOptions) {
@@ -772,12 +859,14 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
772
859
  return transporter.request(request, requestOptions);
773
860
  },
774
861
  /**
775
- * To delete a set of records matching a query, use the [`deleteByQuery` operation](#tag/Records/operation/deleteBy) instead.
862
+ * 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).
863
+ *
864
+ * Required API Key ACLs:
865
+ * - deleteObject.
776
866
  *
777
- * @summary Delete a record.
778
867
  * @param deleteObject - The deleteObject object.
779
- * @param deleteObject.indexName - Index on which to perform the request.
780
- * @param deleteObject.objectID - Unique record (object) identifier.
868
+ * @param deleteObject.indexName - Name of the index on which to perform the operation.
869
+ * @param deleteObject.objectID - Unique record identifier.
781
870
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
782
871
  */
783
872
  deleteObject({ indexName, objectID }, requestOptions) {
@@ -801,13 +890,15 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
801
890
  return transporter.request(request, requestOptions);
802
891
  },
803
892
  /**
804
- * Delete a rule by its `objectID`. To find the `objectID` for rules, use the [`search` operation](#tag/Rules/operation/searchRules).
893
+ * Deletes a rule by its ID. To find the object ID for rules, use the [`search` operation](#tag/Rules/operation/searchRules).
894
+ *
895
+ * Required API Key ACLs:
896
+ * - editSettings.
805
897
  *
806
- * @summary Delete a rule.
807
898
  * @param deleteRule - The deleteRule object.
808
- * @param deleteRule.indexName - Index on which to perform the request.
899
+ * @param deleteRule.indexName - Name of the index on which to perform the operation.
809
900
  * @param deleteRule.objectID - Unique identifier of a rule object.
810
- * @param deleteRule.forwardToReplicas - Indicates whether changed index settings are forwarded to the replica indices.
901
+ * @param deleteRule.forwardToReplicas - Whether changes are applied to replica indices.
811
902
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
812
903
  */
813
904
  deleteRule({ indexName, objectID, forwardToReplicas }, requestOptions) {
@@ -834,9 +925,11 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
834
925
  return transporter.request(request, requestOptions);
835
926
  },
836
927
  /**
837
- * Remove a source from the list of allowed sources.
928
+ * Deletes a source from the list of allowed sources.
929
+ *
930
+ * Required API Key ACLs:
931
+ * - admin.
838
932
  *
839
- * @summary Remove a source.
840
933
  * @param deleteSource - The deleteSource object.
841
934
  * @param deleteSource.source - IP address range of the source.
842
935
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
@@ -857,13 +950,15 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
857
950
  return transporter.request(request, requestOptions);
858
951
  },
859
952
  /**
860
- * Delete a synonym by its `objectID`. To find the object IDs of your synonyms, use the [`search` operation](#tag/Synonyms/operation/searchSynonyms).
953
+ * Deletes a synonym by its ID. To find the object IDs of your synonyms, use the [`search` operation](#tag/Synonyms/operation/searchSynonyms).
954
+ *
955
+ * Required API Key ACLs:
956
+ * - editSettings.
861
957
  *
862
- * @summary Delete a synonym.
863
958
  * @param deleteSynonym - The deleteSynonym object.
864
- * @param deleteSynonym.indexName - Index on which to perform the request.
959
+ * @param deleteSynonym.indexName - Name of the index on which to perform the operation.
865
960
  * @param deleteSynonym.objectID - Unique identifier of a synonym object.
866
- * @param deleteSynonym.forwardToReplicas - Indicates whether changed index settings are forwarded to the replica indices.
961
+ * @param deleteSynonym.forwardToReplicas - Whether changes are applied to replica indices.
867
962
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
868
963
  */
869
964
  deleteSynonym({ indexName, objectID, forwardToReplicas }, requestOptions) {
@@ -890,9 +985,8 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
890
985
  return transporter.request(request, requestOptions);
891
986
  },
892
987
  /**
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.
988
+ * 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
989
  *
895
- * @summary Get API key permissions.
896
990
  * @param getApiKey - The getApiKey object.
897
991
  * @param getApiKey.key - API key.
898
992
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
@@ -913,9 +1007,11 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
913
1007
  return transporter.request(request, requestOptions);
914
1008
  },
915
1009
  /**
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.
1010
+ * Lists supported languages with their supported dictionary types and number of custom entries.
1011
+ *
1012
+ * Required API Key ACLs:
1013
+ * - settings.
917
1014
  *
918
- * @summary List available languages.
919
1015
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
920
1016
  */
921
1017
  getDictionaryLanguages(requestOptions) {
@@ -931,9 +1027,11 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
931
1027
  return transporter.request(request, requestOptions);
932
1028
  },
933
1029
  /**
934
- * Get the languages for which [stop words are turned off](#tag/Dictionaries/operation/setDictionarySettings).
1030
+ * Retrieves the languages for which standard dictionary entries are turned off.
1031
+ *
1032
+ * Required API Key ACLs:
1033
+ * - settings.
935
1034
  *
936
- * @summary Get stop word settings.
937
1035
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
938
1036
  */
939
1037
  getDictionarySettings(requestOptions) {
@@ -949,14 +1047,16 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
949
1047
  return transporter.request(request, requestOptions);
950
1048
  },
951
1049
  /**
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).
1050
+ * 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.
1051
+ *
1052
+ * Required API Key ACLs:
1053
+ * - logs.
953
1054
  *
954
- * @summary Return the latest log entries.
955
1055
  * @param getLogs - The getLogs object.
956
- * @param getLogs.offset - First log entry to retrieve. Sorted by decreasing date with 0 being the most recent.
1056
+ * @param getLogs.offset - First log entry to retrieve. The most recent entries are listed first.
957
1057
  * @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.
1058
+ * @param getLogs.indexName - Index for which to retrieve log entries. By default, log entries are retrieved for all indices.
1059
+ * @param getLogs.type - Type of log entries to retrieve. By default, all log entries are retrieved.
960
1060
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
961
1061
  */
962
1062
  getLogs({ offset, length, indexName, type } = {}, requestOptions = undefined) {
@@ -984,13 +1084,15 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
984
1084
  return transporter.request(request, requestOptions);
985
1085
  },
986
1086
  /**
987
- * To get more than one record, use the [`objects` operation](#tag/Records/operation/getObjects).
1087
+ * Retrieves one record by its object ID. To retrieve more than one record, use the [`objects` operation](#tag/Records/operation/getObjects).
1088
+ *
1089
+ * Required API Key ACLs:
1090
+ * - search.
988
1091
  *
989
- * @summary Get a record.
990
1092
  * @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.
1093
+ * @param getObject.indexName - Name of the index on which to perform the operation.
1094
+ * @param getObject.objectID - Unique record identifier.
1095
+ * @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
1096
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
995
1097
  */
996
1098
  getObject({ indexName, objectID, attributesToRetrieve }, requestOptions) {
@@ -1017,9 +1119,11 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
1017
1119
  return transporter.request(request, requestOptions);
1018
1120
  },
1019
1121
  /**
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.
1122
+ * Retrieves one or more records, potentially from different indices. Records are returned in the same order as the requests.
1123
+ *
1124
+ * Required API Key ACLs:
1125
+ * - search.
1021
1126
  *
1022
- * @summary Get multiple records.
1023
1127
  * @param getObjectsParams - Request object.
1024
1128
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1025
1129
  */
@@ -1045,11 +1149,13 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
1045
1149
  return transporter.request(request, requestOptions);
1046
1150
  },
1047
1151
  /**
1048
- * Get a rule by its `objectID`. To find the `objectID` for rules, use the [`search` operation](#tag/Rules/operation/searchRules).
1152
+ * Retrieves a rule by its ID. To find the object ID of rules, use the [`search` operation](#tag/Rules/operation/searchRules).
1153
+ *
1154
+ * Required API Key ACLs:
1155
+ * - settings.
1049
1156
  *
1050
- * @summary Get a rule.
1051
1157
  * @param getRule - The getRule object.
1052
- * @param getRule.indexName - Index on which to perform the request.
1158
+ * @param getRule.indexName - Name of the index on which to perform the operation.
1053
1159
  * @param getRule.objectID - Unique identifier of a rule object.
1054
1160
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1055
1161
  */
@@ -1074,11 +1180,13 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
1074
1180
  return transporter.request(request, requestOptions);
1075
1181
  },
1076
1182
  /**
1077
- * Return an object containing an index\'s [configuration settings](https://www.algolia.com/doc/api-reference/settings-api-parameters/).
1183
+ * Retrieves an object with non-null index settings.
1184
+ *
1185
+ * Required API Key ACLs:
1186
+ * - search.
1078
1187
  *
1079
- * @summary Get index settings.
1080
1188
  * @param getSettings - The getSettings object.
1081
- * @param getSettings.indexName - Index on which to perform the request.
1189
+ * @param getSettings.indexName - Name of the index on which to perform the operation.
1082
1190
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1083
1191
  */
1084
1192
  getSettings({ indexName }, requestOptions) {
@@ -1097,9 +1205,11 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
1097
1205
  return transporter.request(request, requestOptions);
1098
1206
  },
1099
1207
  /**
1100
- * Get all allowed sources (IP addresses).
1208
+ * Retrieves all allowed IP addresses with access to your application.
1209
+ *
1210
+ * Required API Key ACLs:
1211
+ * - admin.
1101
1212
  *
1102
- * @summary Get all allowed IP addresses.
1103
1213
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1104
1214
  */
1105
1215
  getSources(requestOptions) {
@@ -1115,11 +1225,13 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
1115
1225
  return transporter.request(request, requestOptions);
1116
1226
  },
1117
1227
  /**
1118
- * Get a syonym by its `objectID`. To find the object IDs for your synonyms, use the [`search` operation](#tag/Synonyms/operation/searchSynonyms).
1228
+ * Retrieves a syonym by its ID. To find the object IDs for your synonyms, use the [`search` operation](#tag/Synonyms/operation/searchSynonyms).
1229
+ *
1230
+ * Required API Key ACLs:
1231
+ * - settings.
1119
1232
  *
1120
- * @summary Get a synonym object.
1121
1233
  * @param getSynonym - The getSynonym object.
1122
- * @param getSynonym.indexName - Index on which to perform the request.
1234
+ * @param getSynonym.indexName - Name of the index on which to perform the operation.
1123
1235
  * @param getSynonym.objectID - Unique identifier of a synonym object.
1124
1236
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1125
1237
  */
@@ -1144,11 +1256,13 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
1144
1256
  return transporter.request(request, requestOptions);
1145
1257
  },
1146
1258
  /**
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.
1259
+ * 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.
1260
+ *
1261
+ * Required API Key ACLs:
1262
+ * - addObject.
1148
1263
  *
1149
- * @summary Check a task\'s status.
1150
1264
  * @param getTask - The getTask object.
1151
- * @param getTask.indexName - Index on which to perform the request.
1265
+ * @param getTask.indexName - Name of the index on which to perform the operation.
1152
1266
  * @param getTask.taskID - Unique task identifier.
1153
1267
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1154
1268
  */
@@ -1173,9 +1287,11 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
1173
1287
  return transporter.request(request, requestOptions);
1174
1288
  },
1175
1289
  /**
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.
1290
+ * 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.
1291
+ *
1292
+ * Required API Key ACLs:
1293
+ * - admin.
1177
1294
  *
1178
- * @summary Get top userID.
1179
1295
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1180
1296
  */
1181
1297
  getTopUserIds(requestOptions) {
@@ -1191,11 +1307,13 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
1191
1307
  return transporter.request(request, requestOptions);
1192
1308
  },
1193
1309
  /**
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.
1310
+ * 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.
1311
+ *
1312
+ * Required API Key ACLs:
1313
+ * - admin.
1195
1314
  *
1196
- * @summary Get userID.
1197
1315
  * @param getUserId - The getUserId object.
1198
- * @param getUserId.userID - UserID to assign.
1316
+ * @param getUserId.userID - Unique identifier of the user who makes the search request.
1199
1317
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1200
1318
  */
1201
1319
  getUserId({ userID }, requestOptions) {
@@ -1216,9 +1334,11 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
1216
1334
  /**
1217
1335
  * 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
1336
  *
1219
- * @summary Get migration and user mapping status.
1337
+ * Required API Key ACLs:
1338
+ * - admin.
1339
+ *
1220
1340
  * @param hasPendingMappings - The hasPendingMappings object.
1221
- * @param hasPendingMappings.getClusters - Indicates whether to include the cluster\'s pending mapping state in the response.
1341
+ * @param hasPendingMappings.getClusters - Whether to include the cluster\'s pending mapping state in the response.
1222
1342
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1223
1343
  */
1224
1344
  hasPendingMappings({ getClusters } = {}, requestOptions = undefined) {
@@ -1237,9 +1357,11 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
1237
1357
  return transporter.request(request, requestOptions);
1238
1358
  },
1239
1359
  /**
1240
- * List all API keys associated with your Algolia application, including their permissions and restrictions.
1360
+ * Lists all API keys associated with your Algolia application, including their permissions and restrictions.
1361
+ *
1362
+ * Required API Key ACLs:
1363
+ * - admin.
1241
1364
  *
1242
- * @summary List API keys.
1243
1365
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1244
1366
  */
1245
1367
  listApiKeys(requestOptions) {
@@ -1255,9 +1377,11 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
1255
1377
  return transporter.request(request, requestOptions);
1256
1378
  },
1257
1379
  /**
1258
- * List the available clusters in a multi-cluster setup.
1380
+ * Lists the available clusters in a multi-cluster setup.
1381
+ *
1382
+ * Required API Key ACLs:
1383
+ * - admin.
1259
1384
  *
1260
- * @summary List clusters.
1261
1385
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1262
1386
  */
1263
1387
  listClusters(requestOptions) {
@@ -1273,12 +1397,14 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
1273
1397
  return transporter.request(request, requestOptions);
1274
1398
  },
1275
1399
  /**
1276
- * List indices in an Algolia application.
1400
+ * Lists all indices in the current Algolia application. The request follows any index restrictions of the API key you use to make the request.
1401
+ *
1402
+ * Required API Key ACLs:
1403
+ * - listIndexes.
1277
1404
  *
1278
- * @summary List indices.
1279
1405
  * @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.
1406
+ * @param listIndices.page - Requested page of the API response. If `null`, the API response is not paginated.
1407
+ * @param listIndices.hitsPerPage - Number of hits per page.
1282
1408
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1283
1409
  */
1284
1410
  listIndices({ page, hitsPerPage } = {}, requestOptions = undefined) {
@@ -1300,12 +1426,14 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
1300
1426
  return transporter.request(request, requestOptions);
1301
1427
  },
1302
1428
  /**
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.
1429
+ * 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.
1430
+ *
1431
+ * Required API Key ACLs:
1432
+ * - admin.
1304
1433
  *
1305
- * @summary List userIDs.
1306
1434
  * @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.
1435
+ * @param listUserIds.page - Requested page of the API response. If `null`, the API response is not paginated.
1436
+ * @param listUserIds.hitsPerPage - Number of hits per page.
1309
1437
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1310
1438
  */
1311
1439
  listUserIds({ page, hitsPerPage } = {}, requestOptions = undefined) {
@@ -1327,9 +1455,8 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
1327
1455
  return transporter.request(request, requestOptions);
1328
1456
  },
1329
1457
  /**
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.
1458
+ * 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
1459
  *
1332
- * @summary Batch write operations on multiple indices.
1333
1460
  * @param batchParams - The batchParams object.
1334
1461
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1335
1462
  */
@@ -1353,11 +1480,13 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
1353
1480
  return transporter.request(request, requestOptions);
1354
1481
  },
1355
1482
  /**
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/).
1483
+ * Copies or moves (renames) an index within the same Algolia application. - Existing destination indices are overwritten, except for index-specific API keys and 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/).
1484
+ *
1485
+ * Required API Key ACLs:
1486
+ * - addObject.
1357
1487
  *
1358
- * @summary Copy, move, or rename an index.
1359
1488
  * @param operationIndex - The operationIndex object.
1360
- * @param operationIndex.indexName - Index on which to perform the request.
1489
+ * @param operationIndex.indexName - Name of the index on which to perform the operation.
1361
1490
  * @param operationIndex.operationIndexParams - The operationIndexParams object.
1362
1491
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1363
1492
  */
@@ -1387,14 +1516,16 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
1387
1516
  return transporter.request(request, requestOptions);
1388
1517
  },
1389
1518
  /**
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.
1519
+ * 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.
1520
+ *
1521
+ * Required API Key ACLs:
1522
+ * - addObject.
1391
1523
  *
1392
- * @summary Update record attributes.
1393
1524
  * @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.
1525
+ * @param partialUpdateObject.indexName - Name of the index on which to perform the operation.
1526
+ * @param partialUpdateObject.objectID - Unique record identifier.
1527
+ * @param partialUpdateObject.attributesToUpdate - Attributes with their values.
1528
+ * @param partialUpdateObject.createIfNotExists - Whether to create a new record if it doesn\'t exist.
1398
1529
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1399
1530
  */
1400
1531
  partialUpdateObject({ indexName, objectID, attributesToUpdate, createIfNotExists, }, requestOptions) {
@@ -1425,11 +1556,13 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
1425
1556
  return transporter.request(request, requestOptions);
1426
1557
  },
1427
1558
  /**
1428
- * Remove a userID and its associated data from the multi-clusters.
1559
+ * Deletes a user ID and its associated data from the clusters.
1560
+ *
1561
+ * Required API Key ACLs:
1562
+ * - admin.
1429
1563
  *
1430
- * @summary Remove userID.
1431
1564
  * @param removeUserId - The removeUserId object.
1432
- * @param removeUserId.userID - UserID to assign.
1565
+ * @param removeUserId.userID - Unique identifier of the user who makes the search request.
1433
1566
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1434
1567
  */
1435
1568
  removeUserId({ userID }, requestOptions) {
@@ -1448,9 +1581,11 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
1448
1581
  return transporter.request(request, requestOptions);
1449
1582
  },
1450
1583
  /**
1451
- * Replace all allowed sources.
1584
+ * Replaces the list of allowed sources.
1585
+ *
1586
+ * Required API Key ACLs:
1587
+ * - admin.
1452
1588
  *
1453
- * @summary Replace all sources.
1454
1589
  * @param replaceSources - The replaceSources object.
1455
1590
  * @param replaceSources.source - Allowed sources.
1456
1591
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
@@ -1472,9 +1607,11 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
1472
1607
  return transporter.request(request, requestOptions);
1473
1608
  },
1474
1609
  /**
1475
- * Restore a deleted API key, along with its associated permissions. The request must be authenticated with the admin API key.
1610
+ * 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.
1611
+ *
1612
+ * Required API Key ACLs:
1613
+ * - admin.
1476
1614
  *
1477
- * @summary Restore API key.
1478
1615
  * @param restoreApiKey - The restoreApiKey object.
1479
1616
  * @param restoreApiKey.key - API key.
1480
1617
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
@@ -1495,12 +1632,14 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
1495
1632
  return transporter.request(request, requestOptions);
1496
1633
  },
1497
1634
  /**
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).
1635
+ * 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).
1636
+ *
1637
+ * Required API Key ACLs:
1638
+ * - addObject.
1499
1639
  *
1500
- * @summary Add or update a record.
1501
1640
  * @param saveObject - The saveObject object.
1502
- * @param saveObject.indexName - Index on which to perform the request.
1503
- * @param saveObject.body - The Algolia record.
1641
+ * @param saveObject.indexName - Name of the index on which to perform the operation.
1642
+ * @param saveObject.body - The record, a schemaless object with attributes that are useful in the context of search and discovery.
1504
1643
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1505
1644
  */
1506
1645
  saveObject({ indexName, body }, requestOptions) {
@@ -1523,14 +1662,16 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
1523
1662
  return transporter.request(request, requestOptions);
1524
1663
  },
1525
1664
  /**
1526
- * To create or update more than one rule, use the [`batch` operation](#tag/Rules/operation/saveRules).
1665
+ * 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).
1666
+ *
1667
+ * Required API Key ACLs:
1668
+ * - editSettings.
1527
1669
  *
1528
- * @summary Create or update a rule.
1529
1670
  * @param saveRule - The saveRule object.
1530
- * @param saveRule.indexName - Index on which to perform the request.
1671
+ * @param saveRule.indexName - Name of the index on which to perform the operation.
1531
1672
  * @param saveRule.objectID - Unique identifier of a rule object.
1532
1673
  * @param saveRule.rule - The rule object.
1533
- * @param saveRule.forwardToReplicas - Indicates whether changed index settings are forwarded to the replica indices.
1674
+ * @param saveRule.forwardToReplicas - Whether changes are applied to replica indices.
1534
1675
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1535
1676
  */
1536
1677
  saveRule({ indexName, objectID, rule, forwardToReplicas }, requestOptions) {
@@ -1564,14 +1705,16 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
1564
1705
  return transporter.request(request, requestOptions);
1565
1706
  },
1566
1707
  /**
1567
- * Create or update multiple rules.
1708
+ * 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.
1709
+ *
1710
+ * Required API Key ACLs:
1711
+ * - editSettings.
1568
1712
  *
1569
- * @summary Save a batch of rules.
1570
1713
  * @param saveRules - The saveRules object.
1571
- * @param saveRules.indexName - Index on which to perform the request.
1714
+ * @param saveRules.indexName - Name of the index on which to perform the operation.
1572
1715
  * @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.
1716
+ * @param saveRules.forwardToReplicas - Whether changes are applied to replica indices.
1717
+ * @param saveRules.clearExistingRules - Whether existing rules should be deleted before adding this batch.
1575
1718
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1576
1719
  */
1577
1720
  saveRules({ indexName, rules, forwardToReplicas, clearExistingRules, }, requestOptions) {
@@ -1600,14 +1743,16 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
1600
1743
  return transporter.request(request, requestOptions);
1601
1744
  },
1602
1745
  /**
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).
1746
+ * 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).
1747
+ *
1748
+ * Required API Key ACLs:
1749
+ * - editSettings.
1604
1750
  *
1605
- * @summary Save a synonym.
1606
1751
  * @param saveSynonym - The saveSynonym object.
1607
- * @param saveSynonym.indexName - Index on which to perform the request.
1752
+ * @param saveSynonym.indexName - Name of the index on which to perform the operation.
1608
1753
  * @param saveSynonym.objectID - Unique identifier of a synonym object.
1609
1754
  * @param saveSynonym.synonymHit - The synonymHit object.
1610
- * @param saveSynonym.forwardToReplicas - Indicates whether changed index settings are forwarded to the replica indices.
1755
+ * @param saveSynonym.forwardToReplicas - Whether changes are applied to replica indices.
1611
1756
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1612
1757
  */
1613
1758
  saveSynonym({ indexName, objectID, synonymHit, forwardToReplicas }, requestOptions) {
@@ -1644,14 +1789,16 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
1644
1789
  return transporter.request(request, requestOptions);
1645
1790
  },
1646
1791
  /**
1647
- * Create or update multiple synonyms.
1792
+ * If a synonym with the `objectID` doesn\'t exist, Algolia adds a new one. Otherwise, existing synonyms are replaced.
1793
+ *
1794
+ * Required API Key ACLs:
1795
+ * - editSettings.
1648
1796
  *
1649
- * @summary Save a batch of synonyms.
1650
1797
  * @param saveSynonyms - The saveSynonyms object.
1651
- * @param saveSynonyms.indexName - Index on which to perform the request.
1798
+ * @param saveSynonyms.indexName - Name of the index on which to perform the operation.
1652
1799
  * @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.
1800
+ * @param saveSynonyms.forwardToReplicas - Whether changes are applied to replica indices.
1801
+ * @param saveSynonyms.replaceExistingSynonyms - Whether to replace all synonyms in the index with the ones sent with this request.
1655
1802
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1656
1803
  */
1657
1804
  saveSynonyms({ indexName, synonymHit, forwardToReplicas, replaceExistingSynonyms, }, requestOptions) {
@@ -1681,10 +1828,12 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
1681
1828
  return transporter.request(request, requestOptions);
1682
1829
  },
1683
1830
  /**
1684
- * Send multiple search queries to one or more indices.
1831
+ * 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
1832
  *
1686
- * @summary Search multiple indices.
1687
- * @param searchMethodParams - Query requests and strategies. Results will be received in the same order as the queries.
1833
+ * Required API Key ACLs:
1834
+ * - search.
1835
+ *
1836
+ * @param searchMethodParams - Muli-search request body. Results are returned in the same order as the requests.
1688
1837
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1689
1838
  */
1690
1839
  search(searchMethodParams, requestOptions) {
@@ -1731,11 +1880,13 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
1731
1880
  return transporter.request(request, requestOptions);
1732
1881
  },
1733
1882
  /**
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.
1883
+ * Searches for standard and custom dictionary entries.
1884
+ *
1885
+ * Required API Key ACLs:
1886
+ * - settings.
1735
1887
  *
1736
- * @summary Search dictionary entries.
1737
1888
  * @param searchDictionaryEntries - The searchDictionaryEntries object.
1738
- * @param searchDictionaryEntries.dictionaryName - Dictionary to search in.
1889
+ * @param searchDictionaryEntries.dictionaryName - Dictionary type in which to search.
1739
1890
  * @param searchDictionaryEntries.searchDictionaryEntriesParams - The searchDictionaryEntriesParams object.
1740
1891
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1741
1892
  */
@@ -1764,12 +1915,14 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
1764
1915
  return transporter.request(request, requestOptions);
1765
1916
  },
1766
1917
  /**
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`.
1918
+ * 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**.
1919
+ *
1920
+ * Required API Key ACLs:
1921
+ * - search.
1768
1922
  *
1769
- * @summary Search for facet values.
1770
1923
  * @param searchForFacetValues - The searchForFacetValues object.
1771
- * @param searchForFacetValues.indexName - Index on which to perform the request.
1772
- * @param searchForFacetValues.facetName - Facet name.
1924
+ * @param searchForFacetValues.indexName - Name of the index on which to perform the operation.
1925
+ * @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
1926
  * @param searchForFacetValues.searchForFacetValuesRequest - The searchForFacetValuesRequest object.
1774
1927
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1775
1928
  */
@@ -1797,11 +1950,13 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
1797
1950
  return transporter.request(request, requestOptions);
1798
1951
  },
1799
1952
  /**
1800
- * Search for rules in your index. You can control the search with parameters. To list all rules, send an empty request body.
1953
+ * Searches for rules in your index.
1954
+ *
1955
+ * Required API Key ACLs:
1956
+ * - settings.
1801
1957
  *
1802
- * @summary Search for rules.
1803
1958
  * @param searchRules - The searchRules object.
1804
- * @param searchRules.indexName - Index on which to perform the request.
1959
+ * @param searchRules.indexName - Name of the index on which to perform the operation.
1805
1960
  * @param searchRules.searchRulesParams - The searchRulesParams object.
1806
1961
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1807
1962
  */
@@ -1824,11 +1979,13 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
1824
1979
  return transporter.request(request, requestOptions);
1825
1980
  },
1826
1981
  /**
1827
- * Return records that match the query.
1982
+ * 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.
1983
+ *
1984
+ * Required API Key ACLs:
1985
+ * - search.
1828
1986
  *
1829
- * @summary Search an index.
1830
1987
  * @param searchSingleIndex - The searchSingleIndex object.
1831
- * @param searchSingleIndex.indexName - Index on which to perform the request.
1988
+ * @param searchSingleIndex.indexName - Name of the index on which to perform the operation.
1832
1989
  * @param searchSingleIndex.searchParams - The searchParams object.
1833
1990
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1834
1991
  */
@@ -1851,11 +2008,13 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
1851
2008
  return transporter.request(request, requestOptions);
1852
2009
  },
1853
2010
  /**
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.
2011
+ * Searches for synonyms in your index.
2012
+ *
2013
+ * Required API Key ACLs:
2014
+ * - settings.
1855
2015
  *
1856
- * @summary Search for synonyms.
1857
2016
  * @param searchSynonyms - The searchSynonyms object.
1858
- * @param searchSynonyms.indexName - Index on which to perform the request.
2017
+ * @param searchSynonyms.indexName - Name of the index on which to perform the operation.
1859
2018
  * @param searchSynonyms.searchSynonymsParams - Body of the `searchSynonyms` operation.
1860
2019
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1861
2020
  */
@@ -1878,9 +2037,11 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
1878
2037
  return transporter.request(request, requestOptions);
1879
2038
  },
1880
2039
  /**
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).
2040
+ * 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).
2041
+ *
2042
+ * Required API Key ACLs:
2043
+ * - admin.
1882
2044
  *
1883
- * @summary Search for a user ID.
1884
2045
  * @param searchUserIdsParams - The searchUserIdsParams object.
1885
2046
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1886
2047
  */
@@ -1906,9 +2067,11 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
1906
2067
  return transporter.request(request, requestOptions);
1907
2068
  },
1908
2069
  /**
1909
- * Set stop word settings for a specific language.
2070
+ * Turns standard stop word dictionary entries on or off for a given language.
2071
+ *
2072
+ * Required API Key ACLs:
2073
+ * - editSettings.
1910
2074
  *
1911
- * @summary Set stop word settings.
1912
2075
  * @param dictionarySettingsParams - The dictionarySettingsParams object.
1913
2076
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1914
2077
  */
@@ -1932,13 +2095,15 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
1932
2095
  return transporter.request(request, requestOptions);
1933
2096
  },
1934
2097
  /**
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.
2098
+ * 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.
2099
+ *
2100
+ * Required API Key ACLs:
2101
+ * - editSettings.
1936
2102
  *
1937
- * @summary Update index settings.
1938
2103
  * @param setSettings - The setSettings object.
1939
- * @param setSettings.indexName - Index on which to perform the request.
2104
+ * @param setSettings.indexName - Name of the index on which to perform the operation.
1940
2105
  * @param setSettings.indexSettings - The indexSettings object.
1941
- * @param setSettings.forwardToReplicas - Indicates whether changed index settings are forwarded to the replica indices.
2106
+ * @param setSettings.forwardToReplicas - Whether changes are applied to replica indices.
1942
2107
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1943
2108
  */
1944
2109
  setSettings({ indexName, indexSettings, forwardToReplicas }, requestOptions) {
@@ -1964,9 +2129,11 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
1964
2129
  return transporter.request(request, requestOptions);
1965
2130
  },
1966
2131
  /**
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.
2132
+ * Replaces the permissions of an existing API key. Any unspecified attribute resets that attribute to its default value.
2133
+ *
2134
+ * Required API Key ACLs:
2135
+ * - admin.
1968
2136
  *
1969
- * @summary Update an API key.
1970
2137
  * @param updateApiKey - The updateApiKey object.
1971
2138
  * @param updateApiKey.key - API key.
1972
2139
  * @param updateApiKey.apiKey - The apiKey object.
@@ -1998,6 +2165,7 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
1998
2165
  }
1999
2166
 
2000
2167
  // 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.
2168
+ // eslint-disable-next-line @typescript-eslint/explicit-function-return-type
2001
2169
  function searchClient(appId, apiKey, options) {
2002
2170
  if (!appId || typeof appId !== 'string') {
2003
2171
  throw new Error('`appId` is missing.');
@@ -2005,21 +2173,53 @@ function searchClient(appId, apiKey, options) {
2005
2173
  if (!apiKey || typeof apiKey !== 'string') {
2006
2174
  throw new Error('`apiKey` is missing.');
2007
2175
  }
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
- });
2176
+ return {
2177
+ ...createSearchClient({
2178
+ appId,
2179
+ apiKey,
2180
+ timeouts: {
2181
+ connect: clientCommon.DEFAULT_CONNECT_TIMEOUT_NODE,
2182
+ read: clientCommon.DEFAULT_READ_TIMEOUT_NODE,
2183
+ write: clientCommon.DEFAULT_WRITE_TIMEOUT_NODE,
2184
+ },
2185
+ requester: requesterNodeHttp.createHttpRequester(),
2186
+ algoliaAgents: [{ segment: 'Node.js', version: process.versions.node }],
2187
+ responsesCache: clientCommon.createNullCache(),
2188
+ requestsCache: clientCommon.createNullCache(),
2189
+ hostsCache: clientCommon.createMemoryCache(),
2190
+ ...options,
2191
+ }),
2192
+ /**
2193
+ * Helper: Generates a secured API key based on the given `parentApiKey` and given `restrictions`.
2194
+ *
2195
+ * @summary Helper: Generates a secured API key based on the given `parentApiKey` and given `restrictions`.
2196
+ * @param generateSecuredApiKey - The `generateSecuredApiKey` object.
2197
+ * @param generateSecuredApiKey.parentApiKey - The base API key from which to generate the new secured one.
2198
+ * @param generateSecuredApiKey.restrictions - A set of properties defining the restrictions of the secured API key.
2199
+ */
2200
+ generateSecuredApiKey({ parentApiKey, restrictions = {}, }) {
2201
+ const queryParameters = clientCommon.serializeQueryParameters(restrictions);
2202
+ return Buffer.from(crypto.createHmac('sha256', parentApiKey)
2203
+ .update(queryParameters)
2204
+ .digest('hex') + queryParameters).toString('base64');
2205
+ },
2206
+ /**
2207
+ * Helper: Retrieves the remaining validity of the previous generated `securedApiKey`, the `ValidUntil` parameter must have been provided.
2208
+ *
2209
+ * @summary Helper: Retrieves the remaining validity of the previous generated `secured_api_key`, the `ValidUntil` parameter must have been provided.
2210
+ * @param getSecuredApiKeyRemainingValidity - The `getSecuredApiKeyRemainingValidity` object.
2211
+ * @param getSecuredApiKeyRemainingValidity.securedApiKey - The secured API key generated with the `generateSecuredApiKey` method.
2212
+ */
2213
+ getSecuredApiKeyRemainingValidity({ securedApiKey, }) {
2214
+ const decodedString = Buffer.from(securedApiKey, 'base64').toString('ascii');
2215
+ const regex = /validUntil=(\d+)/;
2216
+ const match = decodedString.match(regex);
2217
+ if (match === null) {
2218
+ throw new Error('validUntil not found in given secured api key.');
2219
+ }
2220
+ return parseInt(match[1], 10) - Math.round(new Date().getTime() / 1000);
2221
+ },
2222
+ };
2023
2223
  }
2024
2224
 
2025
2225
  exports.apiClientVersion = apiClientVersion;