@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,8 +1,9 @@
1
- import { createAuth, createTransporter, getAlgoliaAgent, createIterablePromise, shuffle, DEFAULT_CONNECT_TIMEOUT_NODE, DEFAULT_READ_TIMEOUT_NODE, DEFAULT_WRITE_TIMEOUT_NODE, createNullCache, createMemoryCache } from '@algolia/client-common';
1
+ import { createHmac } from 'crypto';
2
+ import { createAuth, createTransporter, getAlgoliaAgent, createIterablePromise, shuffle, DEFAULT_CONNECT_TIMEOUT_NODE, DEFAULT_READ_TIMEOUT_NODE, DEFAULT_WRITE_TIMEOUT_NODE, createNullCache, createMemoryCache, serializeQueryParameters } from '@algolia/client-common';
2
3
  import { createHttpRequester } from '@algolia/requester-node-http';
3
4
 
4
5
  // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT.
5
- const apiClientVersion = '5.0.0-alpha.99';
6
+ const apiClientVersion = '5.0.0-beta.2';
6
7
  function getDefaultHosts(appId) {
7
8
  return [
8
9
  {
@@ -88,7 +89,7 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
88
89
  * Helper: Wait for a task to be published (completed) for a given `indexName` and `taskID`.
89
90
  *
90
91
  * @summary Helper method that waits for a task to be published (completed).
91
- * @param waitForTaskOptions - The waitForTaskOptions object.
92
+ * @param waitForTaskOptions - The `waitForTaskOptions` object.
92
93
  * @param waitForTaskOptions.indexName - The `indexName` where the operation was performed.
93
94
  * @param waitForTaskOptions.taskID - The `taskID` returned in the method response.
94
95
  * @param waitForTaskOptions.maxRetries - The maximum number of retries. 50 by default.
@@ -112,7 +113,7 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
112
113
  * Helper: Wait for an API key to be added, updated or deleted based on a given `operation`.
113
114
  *
114
115
  * @summary Helper method that waits for an API key task to be processed.
115
- * @param waitForApiKeyOptions - The waitForApiKeyOptions object.
116
+ * @param waitForApiKeyOptions - The `waitForApiKeyOptions` object.
116
117
  * @param waitForApiKeyOptions.operation - The `operation` that was done on a `key`.
117
118
  * @param waitForApiKeyOptions.key - The `key` that has been added, deleted or updated.
118
119
  * @param waitForApiKeyOptions.apiKey - Necessary to know if an `update` operation has been processed, compare fields of the response with it.
@@ -165,7 +166,7 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
165
166
  * Helper: Iterate on the `browse` method of the client to allow aggregating objects of an index.
166
167
  *
167
168
  * @summary Helper method that iterates on the `browse` method.
168
- * @param browseObjects - The browseObjects object.
169
+ * @param browseObjects - The `browseObjects` object.
169
170
  * @param browseObjects.indexName - The index in which to perform the request.
170
171
  * @param browseObjects.browseParams - The `browse` parameters.
171
172
  * @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.
@@ -191,11 +192,11 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
191
192
  * Helper: Iterate on the `searchRules` method of the client to allow aggregating rules of an index.
192
193
  *
193
194
  * @summary Helper method that iterates on the `searchRules` method.
194
- * @param browseObjects - The browseObjects object.
195
- * @param browseObjects.indexName - The index in which to perform the request.
196
- * @param browseObjects.searchRulesParams - The `searchRules` method parameters.
197
- * @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).
198
- * @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`.
195
+ * @param browseRules - The `browseRules` object.
196
+ * @param browseRules.indexName - The index in which to perform the request.
197
+ * @param browseRules.searchRulesParams - The `searchRules` method parameters.
198
+ * @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).
199
+ * @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`.
199
200
  * @param requestOptions - The requestOptions to send along with the query, they will be forwarded to the `searchRules` method and merged with the transporter requestOptions.
200
201
  */
201
202
  browseRules({ indexName, searchRulesParams, ...browseRulesOptions }, requestOptions) {
@@ -223,11 +224,11 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
223
224
  * Helper: Iterate on the `searchSynonyms` method of the client to allow aggregating rules of an index.
224
225
  *
225
226
  * @summary Helper method that iterates on the `searchSynonyms` method.
226
- * @param browseObjects - The browseObjects object.
227
- * @param browseObjects.indexName - The index in which to perform the request.
228
- * @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).
229
- * @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`.
230
- * @param browseObjects.searchSynonymsParams - The `searchSynonyms` method parameters.
227
+ * @param browseSynonyms - The `browseSynonyms` object.
228
+ * @param browseSynonyms.indexName - The index in which to perform the request.
229
+ * @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).
230
+ * @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`.
231
+ * @param browseSynonyms.searchSynonymsParams - The `searchSynonyms` method parameters.
231
232
  * @param requestOptions - The requestOptions to send along with the query, they will be forwarded to the `searchSynonyms` method and merged with the transporter requestOptions.
232
233
  */
233
234
  browseSynonyms({ indexName, searchSynonymsParams, ...browseSynonymsOptions }, requestOptions) {
@@ -237,16 +238,16 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
237
238
  hitsPerPage: 1000,
238
239
  };
239
240
  return createIterablePromise({
240
- func: (previousResponse) => {
241
- return this.searchSynonyms({
241
+ func: (_) => {
242
+ const resp = this.searchSynonyms({
242
243
  indexName,
243
244
  searchSynonymsParams: {
244
245
  ...params,
245
- page: previousResponse
246
- ? previousResponse.page + 1
247
- : params.page,
246
+ page: params.page,
248
247
  },
249
248
  }, requestOptions);
249
+ params.page += 1;
250
+ return resp;
250
251
  },
251
252
  validate: (response) => response.nbHits < params.hitsPerPage,
252
253
  ...browseSynonymsOptions,
@@ -275,9 +276,76 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
275
276
  return this.search(searchMethodParams, requestOptions);
276
277
  },
277
278
  /**
278
- * 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.
279
+ * Helper: Chunks the given `objects` list in subset of 1000 elements max in order to make it fit in `batch` requests.
280
+ *
281
+ * @summary Helper: Chunks the given `objects` list in subset of 1000 elements max in order to make it fit in `batch` requests.
282
+ * @param chunkedBatch - The `chunkedBatch` object.
283
+ * @param chunkedBatch.indexName - The `indexName` to replace `objects` in.
284
+ * @param chunkedBatch.objects - The array of `objects` to store in the given Algolia `indexName`.
285
+ * @param chunkedBatch.action - The `batch` `action` to perform on the given array of `objects`, defaults to `addObject`.
286
+ * @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.
287
+ * @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.
288
+ * @param requestOptions - The requestOptions to send along with the query, they will be forwarded to the `getTask` method and merged with the transporter requestOptions.
289
+ */
290
+ async chunkedBatch({ indexName, objects, action = 'addObject', waitForTasks, batchSize = 1000, }, requestOptions) {
291
+ let requests = [];
292
+ const responses = [];
293
+ for (const [i, obj] of objects.entries()) {
294
+ requests.push({ action, body: obj });
295
+ if (i % batchSize === 0) {
296
+ responses.push(await this.batch({ indexName, batchWriteParams: { requests } }, requestOptions));
297
+ requests = [];
298
+ }
299
+ }
300
+ if (waitForTasks) {
301
+ for (const resp of responses) {
302
+ await this.waitForTask({ indexName, taskID: resp.taskID });
303
+ }
304
+ }
305
+ return responses;
306
+ },
307
+ /**
308
+ * 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.
309
+ *
310
+ * @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.
311
+ * @param replaceAllObjects - The `replaceAllObjects` object.
312
+ * @param replaceAllObjects.indexName - The `indexName` to replace `objects` in.
313
+ * @param replaceAllObjects.objects - The array of `objects` to store in the given Algolia `indexName`.
314
+ * @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.
315
+ * @param requestOptions - The requestOptions to send along with the query, they will be forwarded to the `getTask` method and merged with the transporter requestOptions.
316
+ */
317
+ async replaceAllObjects({ indexName, objects, batchSize }, requestOptions) {
318
+ const randomSuffix = Math.random().toString(36).substring(7);
319
+ const tmpIndexName = `${indexName}_tmp_${randomSuffix}`;
320
+ const copyOperationResponse = await this.operationIndex({
321
+ indexName,
322
+ operationIndexParams: {
323
+ operation: 'copy',
324
+ destination: tmpIndexName,
325
+ scope: ['settings', 'rules', 'synonyms'],
326
+ },
327
+ }, requestOptions);
328
+ await this.waitForTask({
329
+ indexName,
330
+ taskID: copyOperationResponse.taskID,
331
+ });
332
+ const batchResponses = await this.chunkedBatch({ indexName: tmpIndexName, objects, waitForTasks: true, batchSize }, requestOptions);
333
+ const moveOperationResponse = await this.operationIndex({
334
+ indexName: tmpIndexName,
335
+ operationIndexParams: { operation: 'move', destination: indexName },
336
+ }, requestOptions);
337
+ await this.waitForTask({
338
+ indexName,
339
+ taskID: moveOperationResponse.taskID,
340
+ });
341
+ return { copyOperationResponse, batchResponses, moveOperationResponse };
342
+ },
343
+ /**
344
+ * Creates a new API key with specific permissions and restrictions.
345
+ *
346
+ * Required API Key ACLs:
347
+ * - admin.
279
348
  *
280
- * @summary Add API key.
281
349
  * @param apiKey - The apiKey object.
282
350
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
283
351
  */
@@ -301,13 +369,15 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
301
369
  return transporter.request(request, requestOptions);
302
370
  },
303
371
  /**
304
- * 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).
372
+ * 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).
373
+ *
374
+ * Required API Key ACLs:
375
+ * - addObject.
305
376
  *
306
- * @summary Add or update a record (using objectID).
307
377
  * @param addOrUpdateObject - The addOrUpdateObject object.
308
- * @param addOrUpdateObject.indexName - Index on which to perform the request.
309
- * @param addOrUpdateObject.objectID - Unique record (object) identifier.
310
- * @param addOrUpdateObject.body - Algolia record.
378
+ * @param addOrUpdateObject.indexName - Name of the index on which to perform the operation.
379
+ * @param addOrUpdateObject.objectID - Unique record identifier.
380
+ * @param addOrUpdateObject.body - The record, a schemaless object with attributes that are useful in the context of search and discovery.
311
381
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
312
382
  */
313
383
  addOrUpdateObject({ indexName, objectID, body }, requestOptions) {
@@ -335,9 +405,11 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
335
405
  return transporter.request(request, requestOptions);
336
406
  },
337
407
  /**
338
- * Add a source to the list of allowed sources.
408
+ * Adds a source to the list of allowed sources.
409
+ *
410
+ * Required API Key ACLs:
411
+ * - admin.
339
412
  *
340
- * @summary Add a source.
341
413
  * @param source - Source to add.
342
414
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
343
415
  */
@@ -361,11 +433,13 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
361
433
  return transporter.request(request, requestOptions);
362
434
  },
363
435
  /**
364
- * 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.
436
+ * 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.
437
+ *
438
+ * Required API Key ACLs:
439
+ * - admin.
365
440
  *
366
- * @summary Assign or move a user ID.
367
441
  * @param assignUserId - The assignUserId object.
368
- * @param assignUserId.xAlgoliaUserID - UserID to assign.
442
+ * @param assignUserId.xAlgoliaUserID - Unique identifier of the user who makes the search request.
369
443
  * @param assignUserId.assignUserIdParams - The assignUserIdParams object.
370
444
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
371
445
  */
@@ -395,11 +469,10 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
395
469
  return transporter.request(request, requestOptions);
396
470
  },
397
471
  /**
398
- * 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.
472
+ * 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.
399
473
  *
400
- * @summary Batch write operations on one index.
401
474
  * @param batch - The batch object.
402
- * @param batch.indexName - Index on which to perform the request.
475
+ * @param batch.indexName - Name of the index on which to perform the operation.
403
476
  * @param batch.batchWriteParams - The batchWriteParams object.
404
477
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
405
478
  */
@@ -426,11 +499,13 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
426
499
  return transporter.request(request, requestOptions);
427
500
  },
428
501
  /**
429
- * Assign multiple user IDs to a cluster. **You can\'t _move_ users with this operation.**.
502
+ * Assigns multiple user IDs to a cluster. **You can\'t move users with this operation**.
503
+ *
504
+ * Required API Key ACLs:
505
+ * - admin.
430
506
  *
431
- * @summary Batch assign userIDs.
432
507
  * @param batchAssignUserIds - The batchAssignUserIds object.
433
- * @param batchAssignUserIds.xAlgoliaUserID - UserID to assign.
508
+ * @param batchAssignUserIds.xAlgoliaUserID - Unique identifier of the user who makes the search request.
434
509
  * @param batchAssignUserIds.batchAssignUserIdsParams - The batchAssignUserIdsParams object.
435
510
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
436
511
  */
@@ -463,11 +538,13 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
463
538
  return transporter.request(request, requestOptions);
464
539
  },
465
540
  /**
466
- * Add or remove a batch of dictionary entries.
541
+ * Adds or deletes multiple entries from your plurals, segmentation, or stop word dictionaries.
542
+ *
543
+ * Required API Key ACLs:
544
+ * - editSettings.
467
545
  *
468
- * @summary Batch dictionary entries.
469
546
  * @param batchDictionaryEntries - The batchDictionaryEntries object.
470
- * @param batchDictionaryEntries.dictionaryName - Dictionary to search in.
547
+ * @param batchDictionaryEntries.dictionaryName - Dictionary type in which to search.
471
548
  * @param batchDictionaryEntries.batchDictionaryEntriesParams - The batchDictionaryEntriesParams object.
472
549
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
473
550
  */
@@ -494,11 +571,13 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
494
571
  return transporter.request(request, requestOptions);
495
572
  },
496
573
  /**
497
- * 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.
574
+ * 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.
575
+ *
576
+ * Required API Key ACLs:
577
+ * - browse.
498
578
  *
499
- * @summary Get all records from an index.
500
579
  * @param browse - The browse object.
501
- * @param browse.indexName - Index on which to perform the request.
580
+ * @param browse.indexName - Name of the index on which to perform the operation.
502
581
  * @param browse.browseParams - The browseParams object.
503
582
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
504
583
  */
@@ -519,11 +598,13 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
519
598
  return transporter.request(request, requestOptions);
520
599
  },
521
600
  /**
522
- * Delete the records but leave settings and index-specific API keys untouched.
601
+ * Deletes only the records from an index while keeping settings, synonyms, and rules.
602
+ *
603
+ * Required API Key ACLs:
604
+ * - deleteIndex.
523
605
  *
524
- * @summary Delete all records from an index.
525
606
  * @param clearObjects - The clearObjects object.
526
- * @param clearObjects.indexName - Index on which to perform the request.
607
+ * @param clearObjects.indexName - Name of the index on which to perform the operation.
527
608
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
528
609
  */
529
610
  clearObjects({ indexName }, requestOptions) {
@@ -542,12 +623,14 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
542
623
  return transporter.request(request, requestOptions);
543
624
  },
544
625
  /**
545
- * Delete all rules in the index.
626
+ * Deletes all rules from the index.
627
+ *
628
+ * Required API Key ACLs:
629
+ * - editSettings.
546
630
  *
547
- * @summary Delete all rules.
548
631
  * @param clearRules - The clearRules object.
549
- * @param clearRules.indexName - Index on which to perform the request.
550
- * @param clearRules.forwardToReplicas - Indicates whether changed index settings are forwarded to the replica indices.
632
+ * @param clearRules.indexName - Name of the index on which to perform the operation.
633
+ * @param clearRules.forwardToReplicas - Whether changes are applied to replica indices.
551
634
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
552
635
  */
553
636
  clearRules({ indexName, forwardToReplicas }, requestOptions) {
@@ -569,12 +652,14 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
569
652
  return transporter.request(request, requestOptions);
570
653
  },
571
654
  /**
572
- * Delete all synonyms in the index.
655
+ * Deletes all synonyms from the index.
656
+ *
657
+ * Required API Key ACLs:
658
+ * - editSettings.
573
659
  *
574
- * @summary Delete all synonyms.
575
660
  * @param clearSynonyms - The clearSynonyms object.
576
- * @param clearSynonyms.indexName - Index on which to perform the request.
577
- * @param clearSynonyms.forwardToReplicas - Indicates whether changed index settings are forwarded to the replica indices.
661
+ * @param clearSynonyms.indexName - Name of the index on which to perform the operation.
662
+ * @param clearSynonyms.forwardToReplicas - Whether changes are applied to replica indices.
578
663
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
579
664
  */
580
665
  clearSynonyms({ indexName, forwardToReplicas }, requestOptions) {
@@ -598,7 +683,6 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
598
683
  /**
599
684
  * This method allow you to send requests to the Algolia REST API.
600
685
  *
601
- * @summary Send requests to the Algolia REST API.
602
686
  * @param customDelete - The customDelete object.
603
687
  * @param customDelete.path - Path of the endpoint, anything after \"/1\" must be specified.
604
688
  * @param customDelete.parameters - Query parameters to apply to the current query.
@@ -608,7 +692,7 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
608
692
  if (!path) {
609
693
  throw new Error('Parameter `path` is required when calling `customDelete`.');
610
694
  }
611
- const requestPath = '/1{path}'.replace('{path}', path);
695
+ const requestPath = '/{path}'.replace('{path}', path);
612
696
  const headers = {};
613
697
  const queryParameters = parameters ? parameters : {};
614
698
  const request = {
@@ -622,7 +706,6 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
622
706
  /**
623
707
  * This method allow you to send requests to the Algolia REST API.
624
708
  *
625
- * @summary Send requests to the Algolia REST API.
626
709
  * @param customGet - The customGet object.
627
710
  * @param customGet.path - Path of the endpoint, anything after \"/1\" must be specified.
628
711
  * @param customGet.parameters - Query parameters to apply to the current query.
@@ -632,7 +715,7 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
632
715
  if (!path) {
633
716
  throw new Error('Parameter `path` is required when calling `customGet`.');
634
717
  }
635
- const requestPath = '/1{path}'.replace('{path}', path);
718
+ const requestPath = '/{path}'.replace('{path}', path);
636
719
  const headers = {};
637
720
  const queryParameters = parameters ? parameters : {};
638
721
  const request = {
@@ -646,7 +729,6 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
646
729
  /**
647
730
  * This method allow you to send requests to the Algolia REST API.
648
731
  *
649
- * @summary Send requests to the Algolia REST API.
650
732
  * @param customPost - The customPost object.
651
733
  * @param customPost.path - Path of the endpoint, anything after \"/1\" must be specified.
652
734
  * @param customPost.parameters - Query parameters to apply to the current query.
@@ -657,7 +739,7 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
657
739
  if (!path) {
658
740
  throw new Error('Parameter `path` is required when calling `customPost`.');
659
741
  }
660
- const requestPath = '/1{path}'.replace('{path}', path);
742
+ const requestPath = '/{path}'.replace('{path}', path);
661
743
  const headers = {};
662
744
  const queryParameters = parameters ? parameters : {};
663
745
  const request = {
@@ -672,7 +754,6 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
672
754
  /**
673
755
  * This method allow you to send requests to the Algolia REST API.
674
756
  *
675
- * @summary Send requests to the Algolia REST API.
676
757
  * @param customPut - The customPut object.
677
758
  * @param customPut.path - Path of the endpoint, anything after \"/1\" must be specified.
678
759
  * @param customPut.parameters - Query parameters to apply to the current query.
@@ -683,7 +764,7 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
683
764
  if (!path) {
684
765
  throw new Error('Parameter `path` is required when calling `customPut`.');
685
766
  }
686
- const requestPath = '/1{path}'.replace('{path}', path);
767
+ const requestPath = '/{path}'.replace('{path}', path);
687
768
  const headers = {};
688
769
  const queryParameters = parameters ? parameters : {};
689
770
  const request = {
@@ -696,9 +777,11 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
696
777
  return transporter.request(request, requestOptions);
697
778
  },
698
779
  /**
699
- * Delete an existing API key. The request must be authenticated with the admin API key.
780
+ * Deletes the API key.
781
+ *
782
+ * Required API Key ACLs:
783
+ * - admin.
700
784
  *
701
- * @summary Delete API key.
702
785
  * @param deleteApiKey - The deleteApiKey object.
703
786
  * @param deleteApiKey.key - API key.
704
787
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
@@ -719,11 +802,13 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
719
802
  return transporter.request(request, requestOptions);
720
803
  },
721
804
  /**
722
- * 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.
805
+ * 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).
806
+ *
807
+ * Required API Key ACLs:
808
+ * - deleteIndex.
723
809
  *
724
- * @summary Delete all records matching a query.
725
810
  * @param deleteBy - The deleteBy object.
726
- * @param deleteBy.indexName - Index on which to perform the request.
811
+ * @param deleteBy.indexName - Name of the index on which to perform the operation.
727
812
  * @param deleteBy.deleteByParams - The deleteByParams object.
728
813
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
729
814
  */
@@ -747,11 +832,13 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
747
832
  return transporter.request(request, requestOptions);
748
833
  },
749
834
  /**
750
- * Delete an existing index.
835
+ * 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/).
836
+ *
837
+ * Required API Key ACLs:
838
+ * - deleteIndex.
751
839
  *
752
- * @summary Delete index.
753
840
  * @param deleteIndex - The deleteIndex object.
754
- * @param deleteIndex.indexName - Index on which to perform the request.
841
+ * @param deleteIndex.indexName - Name of the index on which to perform the operation.
755
842
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
756
843
  */
757
844
  deleteIndex({ indexName }, requestOptions) {
@@ -770,12 +857,14 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
770
857
  return transporter.request(request, requestOptions);
771
858
  },
772
859
  /**
773
- * To delete a set of records matching a query, use the [`deleteByQuery` operation](#tag/Records/operation/deleteBy) instead.
860
+ * 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).
861
+ *
862
+ * Required API Key ACLs:
863
+ * - deleteObject.
774
864
  *
775
- * @summary Delete a record.
776
865
  * @param deleteObject - The deleteObject object.
777
- * @param deleteObject.indexName - Index on which to perform the request.
778
- * @param deleteObject.objectID - Unique record (object) identifier.
866
+ * @param deleteObject.indexName - Name of the index on which to perform the operation.
867
+ * @param deleteObject.objectID - Unique record identifier.
779
868
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
780
869
  */
781
870
  deleteObject({ indexName, objectID }, requestOptions) {
@@ -799,13 +888,15 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
799
888
  return transporter.request(request, requestOptions);
800
889
  },
801
890
  /**
802
- * Delete a rule by its `objectID`. To find the `objectID` for rules, use the [`search` operation](#tag/Rules/operation/searchRules).
891
+ * Deletes a rule by its ID. To find the object ID for rules, use the [`search` operation](#tag/Rules/operation/searchRules).
892
+ *
893
+ * Required API Key ACLs:
894
+ * - editSettings.
803
895
  *
804
- * @summary Delete a rule.
805
896
  * @param deleteRule - The deleteRule object.
806
- * @param deleteRule.indexName - Index on which to perform the request.
897
+ * @param deleteRule.indexName - Name of the index on which to perform the operation.
807
898
  * @param deleteRule.objectID - Unique identifier of a rule object.
808
- * @param deleteRule.forwardToReplicas - Indicates whether changed index settings are forwarded to the replica indices.
899
+ * @param deleteRule.forwardToReplicas - Whether changes are applied to replica indices.
809
900
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
810
901
  */
811
902
  deleteRule({ indexName, objectID, forwardToReplicas }, requestOptions) {
@@ -832,9 +923,11 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
832
923
  return transporter.request(request, requestOptions);
833
924
  },
834
925
  /**
835
- * Remove a source from the list of allowed sources.
926
+ * Deletes a source from the list of allowed sources.
927
+ *
928
+ * Required API Key ACLs:
929
+ * - admin.
836
930
  *
837
- * @summary Remove a source.
838
931
  * @param deleteSource - The deleteSource object.
839
932
  * @param deleteSource.source - IP address range of the source.
840
933
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
@@ -855,13 +948,15 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
855
948
  return transporter.request(request, requestOptions);
856
949
  },
857
950
  /**
858
- * Delete a synonym by its `objectID`. To find the object IDs of your synonyms, use the [`search` operation](#tag/Synonyms/operation/searchSynonyms).
951
+ * Deletes a synonym by its ID. To find the object IDs of your synonyms, use the [`search` operation](#tag/Synonyms/operation/searchSynonyms).
952
+ *
953
+ * Required API Key ACLs:
954
+ * - editSettings.
859
955
  *
860
- * @summary Delete a synonym.
861
956
  * @param deleteSynonym - The deleteSynonym object.
862
- * @param deleteSynonym.indexName - Index on which to perform the request.
957
+ * @param deleteSynonym.indexName - Name of the index on which to perform the operation.
863
958
  * @param deleteSynonym.objectID - Unique identifier of a synonym object.
864
- * @param deleteSynonym.forwardToReplicas - Indicates whether changed index settings are forwarded to the replica indices.
959
+ * @param deleteSynonym.forwardToReplicas - Whether changes are applied to replica indices.
865
960
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
866
961
  */
867
962
  deleteSynonym({ indexName, objectID, forwardToReplicas }, requestOptions) {
@@ -888,9 +983,8 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
888
983
  return transporter.request(request, requestOptions);
889
984
  },
890
985
  /**
891
- * 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.
986
+ * 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.
892
987
  *
893
- * @summary Get API key permissions.
894
988
  * @param getApiKey - The getApiKey object.
895
989
  * @param getApiKey.key - API key.
896
990
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
@@ -911,9 +1005,11 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
911
1005
  return transporter.request(request, requestOptions);
912
1006
  },
913
1007
  /**
914
- * 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.
1008
+ * Lists supported languages with their supported dictionary types and number of custom entries.
1009
+ *
1010
+ * Required API Key ACLs:
1011
+ * - settings.
915
1012
  *
916
- * @summary List available languages.
917
1013
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
918
1014
  */
919
1015
  getDictionaryLanguages(requestOptions) {
@@ -929,9 +1025,11 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
929
1025
  return transporter.request(request, requestOptions);
930
1026
  },
931
1027
  /**
932
- * Get the languages for which [stop words are turned off](#tag/Dictionaries/operation/setDictionarySettings).
1028
+ * Retrieves the languages for which standard dictionary entries are turned off.
1029
+ *
1030
+ * Required API Key ACLs:
1031
+ * - settings.
933
1032
  *
934
- * @summary Get stop word settings.
935
1033
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
936
1034
  */
937
1035
  getDictionarySettings(requestOptions) {
@@ -947,14 +1045,16 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
947
1045
  return transporter.request(request, requestOptions);
948
1046
  },
949
1047
  /**
950
- * 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).
1048
+ * 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.
1049
+ *
1050
+ * Required API Key ACLs:
1051
+ * - logs.
951
1052
  *
952
- * @summary Return the latest log entries.
953
1053
  * @param getLogs - The getLogs object.
954
- * @param getLogs.offset - First log entry to retrieve. Sorted by decreasing date with 0 being the most recent.
1054
+ * @param getLogs.offset - First log entry to retrieve. The most recent entries are listed first.
955
1055
  * @param getLogs.length - Maximum number of entries to retrieve.
956
- * @param getLogs.indexName - Index for which log entries should be retrieved. When omitted, log entries are retrieved for all indices.
957
- * @param getLogs.type - Type of log entries to retrieve. When omitted, all log entries are retrieved.
1056
+ * @param getLogs.indexName - Index for which to retrieve log entries. By default, log entries are retrieved for all indices.
1057
+ * @param getLogs.type - Type of log entries to retrieve. By default, all log entries are retrieved.
958
1058
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
959
1059
  */
960
1060
  getLogs({ offset, length, indexName, type } = {}, requestOptions = undefined) {
@@ -982,13 +1082,15 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
982
1082
  return transporter.request(request, requestOptions);
983
1083
  },
984
1084
  /**
985
- * To get more than one record, use the [`objects` operation](#tag/Records/operation/getObjects).
1085
+ * Retrieves one record by its object ID. To retrieve more than one record, use the [`objects` operation](#tag/Records/operation/getObjects).
1086
+ *
1087
+ * Required API Key ACLs:
1088
+ * - search.
986
1089
  *
987
- * @summary Get a record.
988
1090
  * @param getObject - The getObject object.
989
- * @param getObject.indexName - Index on which to perform the request.
990
- * @param getObject.objectID - Unique record (object) identifier.
991
- * @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.
1091
+ * @param getObject.indexName - Name of the index on which to perform the operation.
1092
+ * @param getObject.objectID - Unique record identifier.
1093
+ * @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.
992
1094
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
993
1095
  */
994
1096
  getObject({ indexName, objectID, attributesToRetrieve }, requestOptions) {
@@ -1015,9 +1117,11 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
1015
1117
  return transporter.request(request, requestOptions);
1016
1118
  },
1017
1119
  /**
1018
- * 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.
1120
+ * Retrieves one or more records, potentially from different indices. Records are returned in the same order as the requests.
1121
+ *
1122
+ * Required API Key ACLs:
1123
+ * - search.
1019
1124
  *
1020
- * @summary Get multiple records.
1021
1125
  * @param getObjectsParams - Request object.
1022
1126
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1023
1127
  */
@@ -1043,11 +1147,13 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
1043
1147
  return transporter.request(request, requestOptions);
1044
1148
  },
1045
1149
  /**
1046
- * Get a rule by its `objectID`. To find the `objectID` for rules, use the [`search` operation](#tag/Rules/operation/searchRules).
1150
+ * Retrieves a rule by its ID. To find the object ID of rules, use the [`search` operation](#tag/Rules/operation/searchRules).
1151
+ *
1152
+ * Required API Key ACLs:
1153
+ * - settings.
1047
1154
  *
1048
- * @summary Get a rule.
1049
1155
  * @param getRule - The getRule object.
1050
- * @param getRule.indexName - Index on which to perform the request.
1156
+ * @param getRule.indexName - Name of the index on which to perform the operation.
1051
1157
  * @param getRule.objectID - Unique identifier of a rule object.
1052
1158
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1053
1159
  */
@@ -1072,11 +1178,13 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
1072
1178
  return transporter.request(request, requestOptions);
1073
1179
  },
1074
1180
  /**
1075
- * Return an object containing an index\'s [configuration settings](https://www.algolia.com/doc/api-reference/settings-api-parameters/).
1181
+ * Retrieves an object with non-null index settings.
1182
+ *
1183
+ * Required API Key ACLs:
1184
+ * - search.
1076
1185
  *
1077
- * @summary Get index settings.
1078
1186
  * @param getSettings - The getSettings object.
1079
- * @param getSettings.indexName - Index on which to perform the request.
1187
+ * @param getSettings.indexName - Name of the index on which to perform the operation.
1080
1188
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1081
1189
  */
1082
1190
  getSettings({ indexName }, requestOptions) {
@@ -1095,9 +1203,11 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
1095
1203
  return transporter.request(request, requestOptions);
1096
1204
  },
1097
1205
  /**
1098
- * Get all allowed sources (IP addresses).
1206
+ * Retrieves all allowed IP addresses with access to your application.
1207
+ *
1208
+ * Required API Key ACLs:
1209
+ * - admin.
1099
1210
  *
1100
- * @summary Get all allowed IP addresses.
1101
1211
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1102
1212
  */
1103
1213
  getSources(requestOptions) {
@@ -1113,11 +1223,13 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
1113
1223
  return transporter.request(request, requestOptions);
1114
1224
  },
1115
1225
  /**
1116
- * Get a syonym by its `objectID`. To find the object IDs for your synonyms, use the [`search` operation](#tag/Synonyms/operation/searchSynonyms).
1226
+ * Retrieves a syonym by its ID. To find the object IDs for your synonyms, use the [`search` operation](#tag/Synonyms/operation/searchSynonyms).
1227
+ *
1228
+ * Required API Key ACLs:
1229
+ * - settings.
1117
1230
  *
1118
- * @summary Get a synonym object.
1119
1231
  * @param getSynonym - The getSynonym object.
1120
- * @param getSynonym.indexName - Index on which to perform the request.
1232
+ * @param getSynonym.indexName - Name of the index on which to perform the operation.
1121
1233
  * @param getSynonym.objectID - Unique identifier of a synonym object.
1122
1234
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1123
1235
  */
@@ -1142,11 +1254,13 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
1142
1254
  return transporter.request(request, requestOptions);
1143
1255
  },
1144
1256
  /**
1145
- * Some operations, such as copying an index, will respond with a `taskID` value. Use this value here to check the status of that task.
1257
+ * 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.
1258
+ *
1259
+ * Required API Key ACLs:
1260
+ * - addObject.
1146
1261
  *
1147
- * @summary Check a task\'s status.
1148
1262
  * @param getTask - The getTask object.
1149
- * @param getTask.indexName - Index on which to perform the request.
1263
+ * @param getTask.indexName - Name of the index on which to perform the operation.
1150
1264
  * @param getTask.taskID - Unique task identifier.
1151
1265
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1152
1266
  */
@@ -1171,9 +1285,11 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
1171
1285
  return transporter.request(request, requestOptions);
1172
1286
  },
1173
1287
  /**
1174
- * 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.
1288
+ * 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.
1289
+ *
1290
+ * Required API Key ACLs:
1291
+ * - admin.
1175
1292
  *
1176
- * @summary Get top userID.
1177
1293
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1178
1294
  */
1179
1295
  getTopUserIds(requestOptions) {
@@ -1189,11 +1305,13 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
1189
1305
  return transporter.request(request, requestOptions);
1190
1306
  },
1191
1307
  /**
1192
- * 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.
1308
+ * 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.
1309
+ *
1310
+ * Required API Key ACLs:
1311
+ * - admin.
1193
1312
  *
1194
- * @summary Get userID.
1195
1313
  * @param getUserId - The getUserId object.
1196
- * @param getUserId.userID - UserID to assign.
1314
+ * @param getUserId.userID - Unique identifier of the user who makes the search request.
1197
1315
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1198
1316
  */
1199
1317
  getUserId({ userID }, requestOptions) {
@@ -1214,9 +1332,11 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
1214
1332
  /**
1215
1333
  * 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.
1216
1334
  *
1217
- * @summary Get migration and user mapping status.
1335
+ * Required API Key ACLs:
1336
+ * - admin.
1337
+ *
1218
1338
  * @param hasPendingMappings - The hasPendingMappings object.
1219
- * @param hasPendingMappings.getClusters - Indicates whether to include the cluster\'s pending mapping state in the response.
1339
+ * @param hasPendingMappings.getClusters - Whether to include the cluster\'s pending mapping state in the response.
1220
1340
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1221
1341
  */
1222
1342
  hasPendingMappings({ getClusters } = {}, requestOptions = undefined) {
@@ -1235,9 +1355,11 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
1235
1355
  return transporter.request(request, requestOptions);
1236
1356
  },
1237
1357
  /**
1238
- * List all API keys associated with your Algolia application, including their permissions and restrictions.
1358
+ * Lists all API keys associated with your Algolia application, including their permissions and restrictions.
1359
+ *
1360
+ * Required API Key ACLs:
1361
+ * - admin.
1239
1362
  *
1240
- * @summary List API keys.
1241
1363
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1242
1364
  */
1243
1365
  listApiKeys(requestOptions) {
@@ -1253,9 +1375,11 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
1253
1375
  return transporter.request(request, requestOptions);
1254
1376
  },
1255
1377
  /**
1256
- * List the available clusters in a multi-cluster setup.
1378
+ * Lists the available clusters in a multi-cluster setup.
1379
+ *
1380
+ * Required API Key ACLs:
1381
+ * - admin.
1257
1382
  *
1258
- * @summary List clusters.
1259
1383
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1260
1384
  */
1261
1385
  listClusters(requestOptions) {
@@ -1271,12 +1395,14 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
1271
1395
  return transporter.request(request, requestOptions);
1272
1396
  },
1273
1397
  /**
1274
- * List indices in an Algolia application.
1398
+ * Lists all indices in the current Algolia application. The request follows any index restrictions of the API key you use to make the request.
1399
+ *
1400
+ * Required API Key ACLs:
1401
+ * - listIndexes.
1275
1402
  *
1276
- * @summary List indices.
1277
1403
  * @param listIndices - The listIndices object.
1278
- * @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.
1279
- * @param listIndices.hitsPerPage - Maximum number of hits per page.
1404
+ * @param listIndices.page - Requested page of the API response. If `null`, the API response is not paginated.
1405
+ * @param listIndices.hitsPerPage - Number of hits per page.
1280
1406
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1281
1407
  */
1282
1408
  listIndices({ page, hitsPerPage } = {}, requestOptions = undefined) {
@@ -1298,12 +1424,14 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
1298
1424
  return transporter.request(request, requestOptions);
1299
1425
  },
1300
1426
  /**
1301
- * 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.
1427
+ * 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.
1428
+ *
1429
+ * Required API Key ACLs:
1430
+ * - admin.
1302
1431
  *
1303
- * @summary List userIDs.
1304
1432
  * @param listUserIds - The listUserIds object.
1305
- * @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.
1306
- * @param listUserIds.hitsPerPage - Maximum number of hits per page.
1433
+ * @param listUserIds.page - Requested page of the API response. If `null`, the API response is not paginated.
1434
+ * @param listUserIds.hitsPerPage - Number of hits per page.
1307
1435
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1308
1436
  */
1309
1437
  listUserIds({ page, hitsPerPage } = {}, requestOptions = undefined) {
@@ -1325,9 +1453,8 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
1325
1453
  return transporter.request(request, requestOptions);
1326
1454
  },
1327
1455
  /**
1328
- * 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.
1456
+ * 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.
1329
1457
  *
1330
- * @summary Batch write operations on multiple indices.
1331
1458
  * @param batchParams - The batchParams object.
1332
1459
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1333
1460
  */
@@ -1351,11 +1478,13 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
1351
1478
  return transporter.request(request, requestOptions);
1352
1479
  },
1353
1480
  /**
1354
- * 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/).
1481
+ * 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/).
1482
+ *
1483
+ * Required API Key ACLs:
1484
+ * - addObject.
1355
1485
  *
1356
- * @summary Copy, move, or rename an index.
1357
1486
  * @param operationIndex - The operationIndex object.
1358
- * @param operationIndex.indexName - Index on which to perform the request.
1487
+ * @param operationIndex.indexName - Name of the index on which to perform the operation.
1359
1488
  * @param operationIndex.operationIndexParams - The operationIndexParams object.
1360
1489
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1361
1490
  */
@@ -1385,14 +1514,16 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
1385
1514
  return transporter.request(request, requestOptions);
1386
1515
  },
1387
1516
  /**
1388
- * 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.
1517
+ * 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.
1518
+ *
1519
+ * Required API Key ACLs:
1520
+ * - addObject.
1389
1521
  *
1390
- * @summary Update record attributes.
1391
1522
  * @param partialUpdateObject - The partialUpdateObject object.
1392
- * @param partialUpdateObject.indexName - Index on which to perform the request.
1393
- * @param partialUpdateObject.objectID - Unique record (object) identifier.
1394
- * @param partialUpdateObject.attributesToUpdate - Object with attributes to update.
1395
- * @param partialUpdateObject.createIfNotExists - Indicates whether to create a new record if it doesn\'t exist yet.
1523
+ * @param partialUpdateObject.indexName - Name of the index on which to perform the operation.
1524
+ * @param partialUpdateObject.objectID - Unique record identifier.
1525
+ * @param partialUpdateObject.attributesToUpdate - Attributes with their values.
1526
+ * @param partialUpdateObject.createIfNotExists - Whether to create a new record if it doesn\'t exist.
1396
1527
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1397
1528
  */
1398
1529
  partialUpdateObject({ indexName, objectID, attributesToUpdate, createIfNotExists, }, requestOptions) {
@@ -1423,11 +1554,13 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
1423
1554
  return transporter.request(request, requestOptions);
1424
1555
  },
1425
1556
  /**
1426
- * Remove a userID and its associated data from the multi-clusters.
1557
+ * Deletes a user ID and its associated data from the clusters.
1558
+ *
1559
+ * Required API Key ACLs:
1560
+ * - admin.
1427
1561
  *
1428
- * @summary Remove userID.
1429
1562
  * @param removeUserId - The removeUserId object.
1430
- * @param removeUserId.userID - UserID to assign.
1563
+ * @param removeUserId.userID - Unique identifier of the user who makes the search request.
1431
1564
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1432
1565
  */
1433
1566
  removeUserId({ userID }, requestOptions) {
@@ -1446,9 +1579,11 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
1446
1579
  return transporter.request(request, requestOptions);
1447
1580
  },
1448
1581
  /**
1449
- * Replace all allowed sources.
1582
+ * Replaces the list of allowed sources.
1583
+ *
1584
+ * Required API Key ACLs:
1585
+ * - admin.
1450
1586
  *
1451
- * @summary Replace all sources.
1452
1587
  * @param replaceSources - The replaceSources object.
1453
1588
  * @param replaceSources.source - Allowed sources.
1454
1589
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
@@ -1470,9 +1605,11 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
1470
1605
  return transporter.request(request, requestOptions);
1471
1606
  },
1472
1607
  /**
1473
- * Restore a deleted API key, along with its associated permissions. The request must be authenticated with the admin API key.
1608
+ * 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.
1609
+ *
1610
+ * Required API Key ACLs:
1611
+ * - admin.
1474
1612
  *
1475
- * @summary Restore API key.
1476
1613
  * @param restoreApiKey - The restoreApiKey object.
1477
1614
  * @param restoreApiKey.key - API key.
1478
1615
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
@@ -1493,12 +1630,14 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
1493
1630
  return transporter.request(request, requestOptions);
1494
1631
  },
1495
1632
  /**
1496
- * 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).
1633
+ * 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).
1634
+ *
1635
+ * Required API Key ACLs:
1636
+ * - addObject.
1497
1637
  *
1498
- * @summary Add or update a record.
1499
1638
  * @param saveObject - The saveObject object.
1500
- * @param saveObject.indexName - Index on which to perform the request.
1501
- * @param saveObject.body - The Algolia record.
1639
+ * @param saveObject.indexName - Name of the index on which to perform the operation.
1640
+ * @param saveObject.body - The record, a schemaless object with attributes that are useful in the context of search and discovery.
1502
1641
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1503
1642
  */
1504
1643
  saveObject({ indexName, body }, requestOptions) {
@@ -1521,14 +1660,16 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
1521
1660
  return transporter.request(request, requestOptions);
1522
1661
  },
1523
1662
  /**
1524
- * To create or update more than one rule, use the [`batch` operation](#tag/Rules/operation/saveRules).
1663
+ * 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).
1664
+ *
1665
+ * Required API Key ACLs:
1666
+ * - editSettings.
1525
1667
  *
1526
- * @summary Create or update a rule.
1527
1668
  * @param saveRule - The saveRule object.
1528
- * @param saveRule.indexName - Index on which to perform the request.
1669
+ * @param saveRule.indexName - Name of the index on which to perform the operation.
1529
1670
  * @param saveRule.objectID - Unique identifier of a rule object.
1530
1671
  * @param saveRule.rule - The rule object.
1531
- * @param saveRule.forwardToReplicas - Indicates whether changed index settings are forwarded to the replica indices.
1672
+ * @param saveRule.forwardToReplicas - Whether changes are applied to replica indices.
1532
1673
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1533
1674
  */
1534
1675
  saveRule({ indexName, objectID, rule, forwardToReplicas }, requestOptions) {
@@ -1562,14 +1703,16 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
1562
1703
  return transporter.request(request, requestOptions);
1563
1704
  },
1564
1705
  /**
1565
- * Create or update multiple rules.
1706
+ * 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.
1707
+ *
1708
+ * Required API Key ACLs:
1709
+ * - editSettings.
1566
1710
  *
1567
- * @summary Save a batch of rules.
1568
1711
  * @param saveRules - The saveRules object.
1569
- * @param saveRules.indexName - Index on which to perform the request.
1712
+ * @param saveRules.indexName - Name of the index on which to perform the operation.
1570
1713
  * @param saveRules.rules - The rules object.
1571
- * @param saveRules.forwardToReplicas - Indicates whether changed index settings are forwarded to the replica indices.
1572
- * @param saveRules.clearExistingRules - Indicates whether existing rules should be deleted before adding this batch.
1714
+ * @param saveRules.forwardToReplicas - Whether changes are applied to replica indices.
1715
+ * @param saveRules.clearExistingRules - Whether existing rules should be deleted before adding this batch.
1573
1716
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1574
1717
  */
1575
1718
  saveRules({ indexName, rules, forwardToReplicas, clearExistingRules, }, requestOptions) {
@@ -1598,14 +1741,16 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
1598
1741
  return transporter.request(request, requestOptions);
1599
1742
  },
1600
1743
  /**
1601
- * 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).
1744
+ * 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).
1745
+ *
1746
+ * Required API Key ACLs:
1747
+ * - editSettings.
1602
1748
  *
1603
- * @summary Save a synonym.
1604
1749
  * @param saveSynonym - The saveSynonym object.
1605
- * @param saveSynonym.indexName - Index on which to perform the request.
1750
+ * @param saveSynonym.indexName - Name of the index on which to perform the operation.
1606
1751
  * @param saveSynonym.objectID - Unique identifier of a synonym object.
1607
1752
  * @param saveSynonym.synonymHit - The synonymHit object.
1608
- * @param saveSynonym.forwardToReplicas - Indicates whether changed index settings are forwarded to the replica indices.
1753
+ * @param saveSynonym.forwardToReplicas - Whether changes are applied to replica indices.
1609
1754
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1610
1755
  */
1611
1756
  saveSynonym({ indexName, objectID, synonymHit, forwardToReplicas }, requestOptions) {
@@ -1642,14 +1787,16 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
1642
1787
  return transporter.request(request, requestOptions);
1643
1788
  },
1644
1789
  /**
1645
- * Create or update multiple synonyms.
1790
+ * If a synonym with the `objectID` doesn\'t exist, Algolia adds a new one. Otherwise, existing synonyms are replaced.
1791
+ *
1792
+ * Required API Key ACLs:
1793
+ * - editSettings.
1646
1794
  *
1647
- * @summary Save a batch of synonyms.
1648
1795
  * @param saveSynonyms - The saveSynonyms object.
1649
- * @param saveSynonyms.indexName - Index on which to perform the request.
1796
+ * @param saveSynonyms.indexName - Name of the index on which to perform the operation.
1650
1797
  * @param saveSynonyms.synonymHit - The synonymHit object.
1651
- * @param saveSynonyms.forwardToReplicas - Indicates whether changed index settings are forwarded to the replica indices.
1652
- * @param saveSynonyms.replaceExistingSynonyms - Indicates whether to replace all synonyms in the index with the ones sent with this request.
1798
+ * @param saveSynonyms.forwardToReplicas - Whether changes are applied to replica indices.
1799
+ * @param saveSynonyms.replaceExistingSynonyms - Whether to replace all synonyms in the index with the ones sent with this request.
1653
1800
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1654
1801
  */
1655
1802
  saveSynonyms({ indexName, synonymHit, forwardToReplicas, replaceExistingSynonyms, }, requestOptions) {
@@ -1679,10 +1826,12 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
1679
1826
  return transporter.request(request, requestOptions);
1680
1827
  },
1681
1828
  /**
1682
- * Send multiple search queries to one or more indices.
1829
+ * 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.
1683
1830
  *
1684
- * @summary Search multiple indices.
1685
- * @param searchMethodParams - Query requests and strategies. Results will be received in the same order as the queries.
1831
+ * Required API Key ACLs:
1832
+ * - search.
1833
+ *
1834
+ * @param searchMethodParams - Muli-search request body. Results are returned in the same order as the requests.
1686
1835
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1687
1836
  */
1688
1837
  search(searchMethodParams, requestOptions) {
@@ -1729,11 +1878,13 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
1729
1878
  return transporter.request(request, requestOptions);
1730
1879
  },
1731
1880
  /**
1732
- * 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.
1881
+ * Searches for standard and custom dictionary entries.
1882
+ *
1883
+ * Required API Key ACLs:
1884
+ * - settings.
1733
1885
  *
1734
- * @summary Search dictionary entries.
1735
1886
  * @param searchDictionaryEntries - The searchDictionaryEntries object.
1736
- * @param searchDictionaryEntries.dictionaryName - Dictionary to search in.
1887
+ * @param searchDictionaryEntries.dictionaryName - Dictionary type in which to search.
1737
1888
  * @param searchDictionaryEntries.searchDictionaryEntriesParams - The searchDictionaryEntriesParams object.
1738
1889
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1739
1890
  */
@@ -1762,12 +1913,14 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
1762
1913
  return transporter.request(request, requestOptions);
1763
1914
  },
1764
1915
  /**
1765
- * [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`.
1916
+ * 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**.
1917
+ *
1918
+ * Required API Key ACLs:
1919
+ * - search.
1766
1920
  *
1767
- * @summary Search for facet values.
1768
1921
  * @param searchForFacetValues - The searchForFacetValues object.
1769
- * @param searchForFacetValues.indexName - Index on which to perform the request.
1770
- * @param searchForFacetValues.facetName - Facet name.
1922
+ * @param searchForFacetValues.indexName - Name of the index on which to perform the operation.
1923
+ * @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.
1771
1924
  * @param searchForFacetValues.searchForFacetValuesRequest - The searchForFacetValuesRequest object.
1772
1925
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1773
1926
  */
@@ -1795,11 +1948,13 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
1795
1948
  return transporter.request(request, requestOptions);
1796
1949
  },
1797
1950
  /**
1798
- * Search for rules in your index. You can control the search with parameters. To list all rules, send an empty request body.
1951
+ * Searches for rules in your index.
1952
+ *
1953
+ * Required API Key ACLs:
1954
+ * - settings.
1799
1955
  *
1800
- * @summary Search for rules.
1801
1956
  * @param searchRules - The searchRules object.
1802
- * @param searchRules.indexName - Index on which to perform the request.
1957
+ * @param searchRules.indexName - Name of the index on which to perform the operation.
1803
1958
  * @param searchRules.searchRulesParams - The searchRulesParams object.
1804
1959
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1805
1960
  */
@@ -1822,11 +1977,13 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
1822
1977
  return transporter.request(request, requestOptions);
1823
1978
  },
1824
1979
  /**
1825
- * Return records that match the query.
1980
+ * 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.
1981
+ *
1982
+ * Required API Key ACLs:
1983
+ * - search.
1826
1984
  *
1827
- * @summary Search an index.
1828
1985
  * @param searchSingleIndex - The searchSingleIndex object.
1829
- * @param searchSingleIndex.indexName - Index on which to perform the request.
1986
+ * @param searchSingleIndex.indexName - Name of the index on which to perform the operation.
1830
1987
  * @param searchSingleIndex.searchParams - The searchParams object.
1831
1988
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1832
1989
  */
@@ -1849,11 +2006,13 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
1849
2006
  return transporter.request(request, requestOptions);
1850
2007
  },
1851
2008
  /**
1852
- * Search for synonyms in your index. You can control and filter the search with parameters. To get all synonyms, send an empty request body.
2009
+ * Searches for synonyms in your index.
2010
+ *
2011
+ * Required API Key ACLs:
2012
+ * - settings.
1853
2013
  *
1854
- * @summary Search for synonyms.
1855
2014
  * @param searchSynonyms - The searchSynonyms object.
1856
- * @param searchSynonyms.indexName - Index on which to perform the request.
2015
+ * @param searchSynonyms.indexName - Name of the index on which to perform the operation.
1857
2016
  * @param searchSynonyms.searchSynonymsParams - Body of the `searchSynonyms` operation.
1858
2017
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1859
2018
  */
@@ -1876,9 +2035,11 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
1876
2035
  return transporter.request(request, requestOptions);
1877
2036
  },
1878
2037
  /**
1879
- * 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).
2038
+ * 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).
2039
+ *
2040
+ * Required API Key ACLs:
2041
+ * - admin.
1880
2042
  *
1881
- * @summary Search for a user ID.
1882
2043
  * @param searchUserIdsParams - The searchUserIdsParams object.
1883
2044
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1884
2045
  */
@@ -1904,9 +2065,11 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
1904
2065
  return transporter.request(request, requestOptions);
1905
2066
  },
1906
2067
  /**
1907
- * Set stop word settings for a specific language.
2068
+ * Turns standard stop word dictionary entries on or off for a given language.
2069
+ *
2070
+ * Required API Key ACLs:
2071
+ * - editSettings.
1908
2072
  *
1909
- * @summary Set stop word settings.
1910
2073
  * @param dictionarySettingsParams - The dictionarySettingsParams object.
1911
2074
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1912
2075
  */
@@ -1930,13 +2093,15 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
1930
2093
  return transporter.request(request, requestOptions);
1931
2094
  },
1932
2095
  /**
1933
- * 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.
2096
+ * 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.
2097
+ *
2098
+ * Required API Key ACLs:
2099
+ * - editSettings.
1934
2100
  *
1935
- * @summary Update index settings.
1936
2101
  * @param setSettings - The setSettings object.
1937
- * @param setSettings.indexName - Index on which to perform the request.
2102
+ * @param setSettings.indexName - Name of the index on which to perform the operation.
1938
2103
  * @param setSettings.indexSettings - The indexSettings object.
1939
- * @param setSettings.forwardToReplicas - Indicates whether changed index settings are forwarded to the replica indices.
2104
+ * @param setSettings.forwardToReplicas - Whether changes are applied to replica indices.
1940
2105
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1941
2106
  */
1942
2107
  setSettings({ indexName, indexSettings, forwardToReplicas }, requestOptions) {
@@ -1962,9 +2127,11 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
1962
2127
  return transporter.request(request, requestOptions);
1963
2128
  },
1964
2129
  /**
1965
- * 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.
2130
+ * Replaces the permissions of an existing API key. Any unspecified attribute resets that attribute to its default value.
2131
+ *
2132
+ * Required API Key ACLs:
2133
+ * - admin.
1966
2134
  *
1967
- * @summary Update an API key.
1968
2135
  * @param updateApiKey - The updateApiKey object.
1969
2136
  * @param updateApiKey.key - API key.
1970
2137
  * @param updateApiKey.apiKey - The apiKey object.
@@ -1996,6 +2163,7 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
1996
2163
  }
1997
2164
 
1998
2165
  // 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.
2166
+ // eslint-disable-next-line @typescript-eslint/explicit-function-return-type
1999
2167
  function searchClient(appId, apiKey, options) {
2000
2168
  if (!appId || typeof appId !== 'string') {
2001
2169
  throw new Error('`appId` is missing.');
@@ -2003,21 +2171,53 @@ function searchClient(appId, apiKey, options) {
2003
2171
  if (!apiKey || typeof apiKey !== 'string') {
2004
2172
  throw new Error('`apiKey` is missing.');
2005
2173
  }
2006
- return createSearchClient({
2007
- appId,
2008
- apiKey,
2009
- timeouts: {
2010
- connect: DEFAULT_CONNECT_TIMEOUT_NODE,
2011
- read: DEFAULT_READ_TIMEOUT_NODE,
2012
- write: DEFAULT_WRITE_TIMEOUT_NODE,
2013
- },
2014
- requester: createHttpRequester(),
2015
- algoliaAgents: [{ segment: 'Node.js', version: process.versions.node }],
2016
- responsesCache: createNullCache(),
2017
- requestsCache: createNullCache(),
2018
- hostsCache: createMemoryCache(),
2019
- ...options,
2020
- });
2174
+ return {
2175
+ ...createSearchClient({
2176
+ appId,
2177
+ apiKey,
2178
+ timeouts: {
2179
+ connect: DEFAULT_CONNECT_TIMEOUT_NODE,
2180
+ read: DEFAULT_READ_TIMEOUT_NODE,
2181
+ write: DEFAULT_WRITE_TIMEOUT_NODE,
2182
+ },
2183
+ requester: createHttpRequester(),
2184
+ algoliaAgents: [{ segment: 'Node.js', version: process.versions.node }],
2185
+ responsesCache: createNullCache(),
2186
+ requestsCache: createNullCache(),
2187
+ hostsCache: createMemoryCache(),
2188
+ ...options,
2189
+ }),
2190
+ /**
2191
+ * Helper: Generates a secured API key based on the given `parentApiKey` and given `restrictions`.
2192
+ *
2193
+ * @summary Helper: Generates a secured API key based on the given `parentApiKey` and given `restrictions`.
2194
+ * @param generateSecuredApiKey - The `generateSecuredApiKey` object.
2195
+ * @param generateSecuredApiKey.parentApiKey - The base API key from which to generate the new secured one.
2196
+ * @param generateSecuredApiKey.restrictions - A set of properties defining the restrictions of the secured API key.
2197
+ */
2198
+ generateSecuredApiKey({ parentApiKey, restrictions = {}, }) {
2199
+ const queryParameters = serializeQueryParameters(restrictions);
2200
+ return Buffer.from(createHmac('sha256', parentApiKey)
2201
+ .update(queryParameters)
2202
+ .digest('hex') + queryParameters).toString('base64');
2203
+ },
2204
+ /**
2205
+ * Helper: Retrieves the remaining validity of the previous generated `securedApiKey`, the `ValidUntil` parameter must have been provided.
2206
+ *
2207
+ * @summary Helper: Retrieves the remaining validity of the previous generated `secured_api_key`, the `ValidUntil` parameter must have been provided.
2208
+ * @param getSecuredApiKeyRemainingValidity - The `getSecuredApiKeyRemainingValidity` object.
2209
+ * @param getSecuredApiKeyRemainingValidity.securedApiKey - The secured API key generated with the `generateSecuredApiKey` method.
2210
+ */
2211
+ getSecuredApiKeyRemainingValidity({ securedApiKey, }) {
2212
+ const decodedString = Buffer.from(securedApiKey, 'base64').toString('ascii');
2213
+ const regex = /validUntil=(\d+)/;
2214
+ const match = decodedString.match(regex);
2215
+ if (match === null) {
2216
+ throw new Error('validUntil not found in given secured api key.');
2217
+ }
2218
+ return parseInt(match[1], 10) - Math.round(new Date().getTime() / 1000);
2219
+ },
2220
+ };
2021
2221
  }
2022
2222
 
2023
2223
  export { apiClientVersion, searchClient };