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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (291) hide show
  1. package/LICENSE +21 -0
  2. package/dist/builds/browser.d.ts +91 -3
  3. package/dist/builds/browser.d.ts.map +1 -1
  4. package/dist/builds/node.d.ts +109 -3
  5. package/dist/builds/node.d.ts.map +1 -1
  6. package/dist/client-search.cjs +544 -219
  7. package/dist/client-search.esm.browser.js +494 -228
  8. package/dist/client-search.esm.node.js +545 -220
  9. package/dist/client-search.umd.js +2 -2
  10. package/dist/model/acl.d.ts +1 -1
  11. package/dist/model/action.d.ts +1 -1
  12. package/dist/model/addApiKeyResponse.d.ts +1 -1
  13. package/dist/model/anchoring.d.ts +1 -1
  14. package/dist/model/apiKey.d.ts +8 -8
  15. package/dist/model/apiKeyOperation.d.ts +2 -0
  16. package/dist/model/apiKeyOperation.d.ts.map +1 -0
  17. package/dist/model/aroundPrecision.d.ts +1 -1
  18. package/dist/model/aroundPrecisionFromValueInner.d.ts +9 -0
  19. package/dist/model/aroundPrecisionFromValueInner.d.ts.map +1 -1
  20. package/dist/model/aroundRadius.d.ts +1 -1
  21. package/dist/model/aroundRadiusAll.d.ts +3 -0
  22. package/dist/model/aroundRadiusAll.d.ts.map +1 -1
  23. package/dist/model/automaticFacetFilter.d.ts +4 -4
  24. package/dist/model/automaticFacetFilters.d.ts +1 -1
  25. package/dist/model/baseGetApiKeyResponse.d.ts +1 -1
  26. package/dist/model/baseIndexSettings.d.ts +23 -18
  27. package/dist/model/baseIndexSettings.d.ts.map +1 -1
  28. package/dist/model/baseSearchParamsWithoutQuery.d.ts +26 -29
  29. package/dist/model/baseSearchParamsWithoutQuery.d.ts.map +1 -1
  30. package/dist/model/baseSearchResponse.d.ts +8 -20
  31. package/dist/model/baseSearchResponse.d.ts.map +1 -1
  32. package/dist/model/batchDictionaryEntriesParams.d.ts +3 -3
  33. package/dist/model/batchResponse.d.ts +2 -2
  34. package/dist/model/browsePagination.d.ts +19 -0
  35. package/dist/model/browsePagination.d.ts.map +1 -0
  36. package/dist/model/browseResponse.d.ts +2 -1
  37. package/dist/model/browseResponse.d.ts.map +1 -1
  38. package/dist/model/builtInOperation.d.ts +2 -2
  39. package/dist/model/builtInOperationType.d.ts +1 -1
  40. package/dist/model/clientMethodProps.d.ts +137 -70
  41. package/dist/model/clientMethodProps.d.ts.map +1 -1
  42. package/dist/model/condition.d.ts +7 -3
  43. package/dist/model/condition.d.ts.map +1 -1
  44. package/dist/model/consequence.d.ts +5 -5
  45. package/dist/model/consequenceHide.d.ts +2 -2
  46. package/dist/model/consequenceQuery.d.ts +1 -1
  47. package/dist/model/consequenceQueryObject.d.ts +2 -2
  48. package/dist/model/createdAtResponse.d.ts +1 -1
  49. package/dist/model/cursor.d.ts +1 -1
  50. package/dist/model/deleteApiKeyResponse.d.ts +1 -1
  51. package/dist/model/deleteByParams.d.ts +4 -4
  52. package/dist/model/deleteSourceResponse.d.ts +1 -1
  53. package/dist/model/deletedAtResponse.d.ts +2 -2
  54. package/dist/model/dictionaryEntry.d.ts +6 -8
  55. package/dist/model/dictionaryEntry.d.ts.map +1 -1
  56. package/dist/model/dictionaryEntryState.d.ts +1 -1
  57. package/dist/model/dictionaryLanguage.d.ts +2 -2
  58. package/dist/model/dictionarySettingsParams.d.ts +1 -1
  59. package/dist/model/distinct.d.ts +1 -1
  60. package/dist/model/edit.d.ts +1 -1
  61. package/dist/model/exactOnSingleWordQuery.d.ts +1 -1
  62. package/dist/model/facetFilters.d.ts +2 -3
  63. package/dist/model/facetFilters.d.ts.map +1 -1
  64. package/dist/model/facetHits.d.ts +2 -2
  65. package/dist/model/facetOrdering.d.ts +2 -2
  66. package/dist/model/facets.d.ts +2 -2
  67. package/dist/model/fetchedIndex.d.ts +5 -1
  68. package/dist/model/fetchedIndex.d.ts.map +1 -1
  69. package/dist/model/getObjectsRequest.d.ts +3 -3
  70. package/dist/model/getObjectsResponse.d.ts +1 -1
  71. package/dist/model/hasPendingMappingsResponse.d.ts +1 -1
  72. package/dist/model/highlightResult.d.ts +1 -1
  73. package/dist/model/highlightResult.d.ts.map +1 -1
  74. package/dist/model/highlightResultOption.d.ts +3 -3
  75. package/dist/model/hit.d.ts +4 -4
  76. package/dist/model/ignorePlurals.d.ts +3 -2
  77. package/dist/model/ignorePlurals.d.ts.map +1 -1
  78. package/dist/model/index.d.ts +8 -1
  79. package/dist/model/index.d.ts.map +1 -1
  80. package/dist/model/indexSettings.d.ts +1 -1
  81. package/dist/model/indexSettingsAsSearchParams.d.ts +32 -35
  82. package/dist/model/indexSettingsAsSearchParams.d.ts.map +1 -1
  83. package/dist/model/log.d.ts +11 -11
  84. package/dist/model/logQuery.d.ts +1 -1
  85. package/dist/model/matchLevel.d.ts +1 -1
  86. package/dist/model/mode.d.ts +1 -1
  87. package/dist/model/multipleBatchRequest.d.ts +1 -1
  88. package/dist/model/multipleBatchResponse.d.ts +2 -2
  89. package/dist/model/numericFilters.d.ts +2 -3
  90. package/dist/model/numericFilters.d.ts.map +1 -1
  91. package/dist/model/operationIndexParams.d.ts +2 -2
  92. package/dist/model/operationType.d.ts +1 -1
  93. package/dist/model/optionalFilters.d.ts +2 -3
  94. package/dist/model/optionalFilters.d.ts.map +1 -1
  95. package/dist/model/params.d.ts +1 -1
  96. package/dist/model/promoteObjectID.d.ts +2 -2
  97. package/dist/model/promoteObjectIDs.d.ts +2 -2
  98. package/dist/model/queryType.d.ts +1 -1
  99. package/dist/model/rankingInfo.d.ts +13 -10
  100. package/dist/model/rankingInfo.d.ts.map +1 -1
  101. package/dist/model/reRankingApplyFilter.d.ts +2 -3
  102. package/dist/model/reRankingApplyFilter.d.ts.map +1 -1
  103. package/dist/model/redirect.d.ts +1 -1
  104. package/dist/model/redirectURL.d.ts +7 -0
  105. package/dist/model/redirectURL.d.ts.map +1 -0
  106. package/dist/model/removeStopWords.d.ts +3 -2
  107. package/dist/model/removeStopWords.d.ts.map +1 -1
  108. package/dist/model/removeUserIdResponse.d.ts +1 -1
  109. package/dist/model/removeWordsIfNoResults.d.ts +1 -1
  110. package/dist/model/renderingContent.d.ts +3 -1
  111. package/dist/model/renderingContent.d.ts.map +1 -1
  112. package/dist/model/replaceAllObjectsResponse.d.ts +11 -0
  113. package/dist/model/replaceAllObjectsResponse.d.ts.map +1 -0
  114. package/dist/model/replaceSourceResponse.d.ts +1 -1
  115. package/dist/model/rule.d.ts +5 -5
  116. package/dist/model/saveObjectResponse.d.ts +3 -3
  117. package/dist/model/saveSynonymResponse.d.ts +2 -2
  118. package/dist/model/searchDictionaryEntriesParams.d.ts +5 -7
  119. package/dist/model/searchDictionaryEntriesParams.d.ts.map +1 -1
  120. package/dist/model/searchDictionaryEntriesResponse.d.ts +20 -0
  121. package/dist/model/searchDictionaryEntriesResponse.d.ts.map +1 -0
  122. package/dist/model/searchForFacetValuesRequest.d.ts +1 -1
  123. package/dist/model/searchForFacetValuesResponse.d.ts +4 -1
  124. package/dist/model/searchForFacetValuesResponse.d.ts.map +1 -1
  125. package/dist/model/searchForFacetsOptions.d.ts +2 -2
  126. package/dist/model/searchForHitsOptions.d.ts +1 -1
  127. package/dist/model/searchHits.d.ts +6 -3
  128. package/dist/model/searchHits.d.ts.map +1 -1
  129. package/dist/model/searchPagination.d.ts +19 -0
  130. package/dist/model/searchPagination.d.ts.map +1 -0
  131. package/dist/model/searchParamsObject.d.ts +3 -0
  132. package/dist/model/searchParamsObject.d.ts.map +1 -1
  133. package/dist/model/searchParamsQuery.d.ts +1 -1
  134. package/dist/model/searchResponse.d.ts +2 -1
  135. package/dist/model/searchResponse.d.ts.map +1 -1
  136. package/dist/model/searchRulesParams.d.ts +4 -8
  137. package/dist/model/searchRulesParams.d.ts.map +1 -1
  138. package/dist/model/searchRulesResponse.d.ts +2 -2
  139. package/dist/model/searchStrategy.d.ts +1 -1
  140. package/dist/model/searchSynonymsParams.d.ts +2 -2
  141. package/dist/model/searchSynonymsResponse.d.ts +2 -2
  142. package/dist/model/searchUserIdsParams.d.ts +1 -1
  143. package/dist/model/searchUserIdsResponse.d.ts +3 -3
  144. package/dist/model/securedApiKeyRestrictions.d.ts +25 -0
  145. package/dist/model/securedApiKeyRestrictions.d.ts.map +1 -0
  146. package/dist/model/semanticSearch.d.ts +2 -2
  147. package/dist/model/snippetResult.d.ts +1 -1
  148. package/dist/model/snippetResult.d.ts.map +1 -1
  149. package/dist/model/snippetResultOption.d.ts +2 -2
  150. package/dist/model/sortRemainingBy.d.ts +1 -1
  151. package/dist/model/supportedLanguage.d.ts +5 -0
  152. package/dist/model/supportedLanguage.d.ts.map +1 -0
  153. package/dist/model/tagFilters.d.ts +2 -3
  154. package/dist/model/tagFilters.d.ts.map +1 -1
  155. package/dist/model/taskStatus.d.ts +1 -1
  156. package/dist/model/timeRange.d.ts +2 -2
  157. package/dist/model/typoTolerance.d.ts +1 -1
  158. package/dist/model/typoToleranceEnum.d.ts +3 -0
  159. package/dist/model/typoToleranceEnum.d.ts.map +1 -1
  160. package/dist/model/updateApiKeyResponse.d.ts +1 -1
  161. package/dist/model/updatedAtResponse.d.ts +2 -2
  162. package/dist/model/updatedAtWithObjectIdResponse.d.ts +3 -3
  163. package/dist/model/updatedRuleResponse.d.ts +3 -3
  164. package/dist/model/userHit.d.ts +1 -1
  165. package/dist/model/userId.d.ts +1 -1
  166. package/dist/model/value.d.ts +5 -1
  167. package/dist/model/value.d.ts.map +1 -1
  168. package/dist/src/searchClient.d.ts +385 -208
  169. package/dist/src/searchClient.d.ts.map +1 -1
  170. package/model/acl.ts +1 -1
  171. package/model/action.ts +1 -1
  172. package/model/addApiKeyResponse.ts +1 -1
  173. package/model/anchoring.ts +1 -1
  174. package/model/apiKey.ts +8 -8
  175. package/model/{mixedSearchFilters.ts → apiKeyOperation.ts} +1 -1
  176. package/model/aroundPrecision.ts +1 -1
  177. package/model/aroundPrecisionFromValueInner.ts +9 -0
  178. package/model/aroundRadius.ts +1 -1
  179. package/model/aroundRadiusAll.ts +3 -0
  180. package/model/automaticFacetFilter.ts +4 -4
  181. package/model/automaticFacetFilters.ts +1 -1
  182. package/model/baseGetApiKeyResponse.ts +1 -1
  183. package/model/baseIndexSettings.ts +25 -18
  184. package/model/baseSearchParamsWithoutQuery.ts +26 -30
  185. package/model/baseSearchResponse.ts +9 -24
  186. package/model/batchDictionaryEntriesParams.ts +3 -3
  187. package/model/batchResponse.ts +2 -2
  188. package/model/browsePagination.ts +23 -0
  189. package/model/browseResponse.ts +2 -0
  190. package/model/builtInOperation.ts +2 -2
  191. package/model/builtInOperationType.ts +1 -1
  192. package/model/clientMethodProps.ts +156 -70
  193. package/model/condition.ts +8 -3
  194. package/model/consequence.ts +5 -5
  195. package/model/consequenceHide.ts +2 -2
  196. package/model/consequenceQuery.ts +1 -1
  197. package/model/consequenceQueryObject.ts +2 -2
  198. package/model/createdAtResponse.ts +1 -1
  199. package/model/cursor.ts +1 -1
  200. package/model/deleteApiKeyResponse.ts +1 -1
  201. package/model/deleteByParams.ts +4 -4
  202. package/model/deleteSourceResponse.ts +1 -1
  203. package/model/deletedAtResponse.ts +2 -2
  204. package/model/dictionaryEntry.ts +6 -8
  205. package/model/dictionaryEntryState.ts +1 -1
  206. package/model/dictionaryLanguage.ts +2 -2
  207. package/model/dictionarySettingsParams.ts +1 -1
  208. package/model/distinct.ts +1 -1
  209. package/model/edit.ts +1 -1
  210. package/model/exactOnSingleWordQuery.ts +1 -1
  211. package/model/facetFilters.ts +2 -4
  212. package/model/facetHits.ts +2 -2
  213. package/model/facetOrdering.ts +2 -2
  214. package/model/facets.ts +2 -2
  215. package/model/fetchedIndex.ts +6 -1
  216. package/model/getObjectsRequest.ts +3 -3
  217. package/model/getObjectsResponse.ts +1 -1
  218. package/model/hasPendingMappingsResponse.ts +1 -1
  219. package/model/highlightResult.ts +1 -0
  220. package/model/highlightResultOption.ts +3 -3
  221. package/model/hit.ts +4 -4
  222. package/model/ignorePlurals.ts +4 -2
  223. package/model/index.ts +8 -1
  224. package/model/indexSettings.ts +1 -1
  225. package/model/indexSettingsAsSearchParams.ts +32 -36
  226. package/model/log.ts +11 -11
  227. package/model/logQuery.ts +1 -1
  228. package/model/matchLevel.ts +1 -1
  229. package/model/mode.ts +1 -1
  230. package/model/multipleBatchRequest.ts +1 -1
  231. package/model/multipleBatchResponse.ts +2 -2
  232. package/model/numericFilters.ts +2 -4
  233. package/model/operationIndexParams.ts +2 -2
  234. package/model/operationType.ts +1 -1
  235. package/model/optionalFilters.ts +2 -4
  236. package/model/params.ts +1 -1
  237. package/model/promoteObjectID.ts +2 -2
  238. package/model/promoteObjectIDs.ts +2 -2
  239. package/model/queryType.ts +1 -1
  240. package/model/rankingInfo.ts +13 -10
  241. package/model/reRankingApplyFilter.ts +2 -4
  242. package/model/redirect.ts +1 -1
  243. package/model/redirectURL.ts +8 -0
  244. package/model/removeStopWords.ts +4 -2
  245. package/model/removeUserIdResponse.ts +1 -1
  246. package/model/removeWordsIfNoResults.ts +1 -1
  247. package/model/renderingContent.ts +4 -1
  248. package/model/replaceAllObjectsResponse.ts +15 -0
  249. package/model/replaceSourceResponse.ts +1 -1
  250. package/model/rule.ts +5 -5
  251. package/model/saveObjectResponse.ts +3 -3
  252. package/model/saveSynonymResponse.ts +2 -2
  253. package/model/searchDictionaryEntriesParams.ts +6 -7
  254. package/model/searchDictionaryEntriesResponse.ts +25 -0
  255. package/model/searchForFacetValuesRequest.ts +1 -1
  256. package/model/searchForFacetValuesResponse.ts +4 -1
  257. package/model/searchForFacetsOptions.ts +2 -2
  258. package/model/searchForHitsOptions.ts +1 -1
  259. package/model/searchHits.ts +6 -3
  260. package/model/searchPagination.ts +23 -0
  261. package/model/searchParamsObject.ts +3 -0
  262. package/model/searchParamsQuery.ts +1 -1
  263. package/model/searchResponse.ts +3 -1
  264. package/model/searchRulesParams.ts +4 -9
  265. package/model/searchRulesResponse.ts +2 -2
  266. package/model/searchStrategy.ts +1 -1
  267. package/model/searchSynonymsParams.ts +2 -2
  268. package/model/searchSynonymsResponse.ts +2 -2
  269. package/model/searchUserIdsParams.ts +1 -1
  270. package/model/searchUserIdsResponse.ts +3 -3
  271. package/model/securedApiKeyRestrictions.ts +32 -0
  272. package/model/semanticSearch.ts +2 -2
  273. package/model/snippetResult.ts +2 -1
  274. package/model/snippetResultOption.ts +2 -2
  275. package/model/sortRemainingBy.ts +1 -1
  276. package/model/supportedLanguage.ts +74 -0
  277. package/model/tagFilters.ts +2 -4
  278. package/model/taskStatus.ts +1 -1
  279. package/model/timeRange.ts +2 -2
  280. package/model/typoTolerance.ts +1 -1
  281. package/model/typoToleranceEnum.ts +3 -0
  282. package/model/updateApiKeyResponse.ts +1 -1
  283. package/model/updatedAtResponse.ts +2 -2
  284. package/model/updatedAtWithObjectIdResponse.ts +3 -3
  285. package/model/updatedRuleResponse.ts +3 -3
  286. package/model/userHit.ts +1 -1
  287. package/model/userId.ts +1 -1
  288. package/model/value.ts +6 -1
  289. package/package.json +11 -8
  290. package/dist/model/mixedSearchFilters.d.ts +0 -2
  291. package/dist/model/mixedSearchFilters.d.ts.map +0 -1
@@ -1,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.10';
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.
@@ -108,11 +109,34 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
108
109
  timeout: () => timeout(retryCount),
109
110
  });
110
111
  },
112
+ /**
113
+ * Helper: Wait for an application-level task to complete for a given `taskID`.
114
+ *
115
+ * @summary Helper method that waits for a task to be published (completed).
116
+ * @param waitForAppTaskOptions - The `waitForTaskOptions` object.
117
+ * @param waitForAppTaskOptions.taskID - The `taskID` returned in the method response.
118
+ * @param waitForAppTaskOptions.maxRetries - The maximum number of retries. 50 by default.
119
+ * @param waitForAppTaskOptions.timeout - The function to decide how long to wait between retries.
120
+ * @param requestOptions - The requestOptions to send along with the query, they will be forwarded to the `getTask` method and merged with the transporter requestOptions.
121
+ */
122
+ waitForAppTask({ taskID, maxRetries = 50, timeout = (retryCount) => Math.min(retryCount * 200, 5000), }, requestOptions) {
123
+ let retryCount = 0;
124
+ return createIterablePromise({
125
+ func: () => this.getAppTask({ taskID }, requestOptions),
126
+ validate: (response) => response.status === 'published',
127
+ aggregator: () => (retryCount += 1),
128
+ error: {
129
+ validate: () => retryCount >= maxRetries,
130
+ message: () => `The maximum number of retries exceeded. (${retryCount}/${maxRetries})`,
131
+ },
132
+ timeout: () => timeout(retryCount),
133
+ });
134
+ },
111
135
  /**
112
136
  * Helper: Wait for an API key to be added, updated or deleted based on a given `operation`.
113
137
  *
114
138
  * @summary Helper method that waits for an API key task to be processed.
115
- * @param waitForApiKeyOptions - The waitForApiKeyOptions object.
139
+ * @param waitForApiKeyOptions - The `waitForApiKeyOptions` object.
116
140
  * @param waitForApiKeyOptions.operation - The `operation` that was done on a `key`.
117
141
  * @param waitForApiKeyOptions.key - The `key` that has been added, deleted or updated.
118
142
  * @param waitForApiKeyOptions.apiKey - Necessary to know if an `update` operation has been processed, compare fields of the response with it.
@@ -165,7 +189,7 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
165
189
  * Helper: Iterate on the `browse` method of the client to allow aggregating objects of an index.
166
190
  *
167
191
  * @summary Helper method that iterates on the `browse` method.
168
- * @param browseObjects - The browseObjects object.
192
+ * @param browseObjects - The `browseObjects` object.
169
193
  * @param browseObjects.indexName - The index in which to perform the request.
170
194
  * @param browseObjects.browseParams - The `browse` parameters.
171
195
  * @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 +215,11 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
191
215
  * Helper: Iterate on the `searchRules` method of the client to allow aggregating rules of an index.
192
216
  *
193
217
  * @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`.
218
+ * @param browseRules - The `browseRules` object.
219
+ * @param browseRules.indexName - The index in which to perform the request.
220
+ * @param browseRules.searchRulesParams - The `searchRules` method parameters.
221
+ * @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).
222
+ * @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
223
  * @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
224
  */
201
225
  browseRules({ indexName, searchRulesParams, ...browseRulesOptions }, requestOptions) {
@@ -223,11 +247,11 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
223
247
  * Helper: Iterate on the `searchSynonyms` method of the client to allow aggregating rules of an index.
224
248
  *
225
249
  * @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.
250
+ * @param browseSynonyms - The `browseSynonyms` object.
251
+ * @param browseSynonyms.indexName - The index in which to perform the request.
252
+ * @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).
253
+ * @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`.
254
+ * @param browseSynonyms.searchSynonymsParams - The `searchSynonyms` method parameters.
231
255
  * @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
256
  */
233
257
  browseSynonyms({ indexName, searchSynonymsParams, ...browseSynonymsOptions }, requestOptions) {
@@ -237,16 +261,16 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
237
261
  hitsPerPage: 1000,
238
262
  };
239
263
  return createIterablePromise({
240
- func: (previousResponse) => {
241
- return this.searchSynonyms({
264
+ func: (_) => {
265
+ const resp = this.searchSynonyms({
242
266
  indexName,
243
267
  searchSynonymsParams: {
244
268
  ...params,
245
- page: previousResponse
246
- ? previousResponse.page + 1
247
- : params.page,
269
+ page: params.page,
248
270
  },
249
271
  }, requestOptions);
272
+ params.page += 1;
273
+ return resp;
250
274
  },
251
275
  validate: (response) => response.nbHits < params.hitsPerPage,
252
276
  ...browseSynonymsOptions,
@@ -275,9 +299,137 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
275
299
  return this.search(searchMethodParams, requestOptions);
276
300
  },
277
301
  /**
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.
302
+ * Helper: Chunks the given `objects` list in subset of 1000 elements max in order to make it fit in `batch` requests.
303
+ *
304
+ * @summary Helper: Chunks the given `objects` list in subset of 1000 elements max in order to make it fit in `batch` requests.
305
+ * @param chunkedBatch - The `chunkedBatch` object.
306
+ * @param chunkedBatch.indexName - The `indexName` to replace `objects` in.
307
+ * @param chunkedBatch.objects - The array of `objects` to store in the given Algolia `indexName`.
308
+ * @param chunkedBatch.action - The `batch` `action` to perform on the given array of `objects`, defaults to `addObject`.
309
+ * @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.
310
+ * @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.
311
+ * @param requestOptions - The requestOptions to send along with the query, they will be forwarded to the `getTask` method and merged with the transporter requestOptions.
312
+ */
313
+ async chunkedBatch({ indexName, objects, action = 'addObject', waitForTasks, batchSize = 1000, }, requestOptions) {
314
+ let requests = [];
315
+ const responses = [];
316
+ const objectEntries = objects.entries();
317
+ for (const [i, obj] of objectEntries) {
318
+ requests.push({ action, body: obj });
319
+ if (requests.length === batchSize || i === objects.length - 1) {
320
+ responses.push(await this.batch({ indexName, batchWriteParams: { requests } }, requestOptions));
321
+ requests = [];
322
+ }
323
+ }
324
+ if (waitForTasks) {
325
+ for (const resp of responses) {
326
+ await this.waitForTask({ indexName, taskID: resp.taskID });
327
+ }
328
+ }
329
+ return responses;
330
+ },
331
+ /**
332
+ * Helper: Saves the given array of objects in the given index. The `chunkedBatch` helper is used under the hood, which creates a `batch` requests with at most 1000 objects in it.
333
+ *
334
+ * @summary Helper: Saves the given array of objects in the given index. The `chunkedBatch` helper is used under the hood, which creates a `batch` requests with at most 1000 objects in it.
335
+ * @param saveObjects - The `saveObjects` object.
336
+ * @param saveObjects.indexName - The `indexName` to save `objects` in.
337
+ * @param saveObjects.objects - The array of `objects` to store in the given Algolia `indexName`.
338
+ * @param requestOptions - The requestOptions to send along with the query, they will be forwarded to the `batch` method and merged with the transporter requestOptions.
339
+ */
340
+ async saveObjects({ indexName, objects }, requestOptions) {
341
+ return await this.chunkedBatch({ indexName, objects, action: 'addObject' }, requestOptions);
342
+ },
343
+ /**
344
+ * Helper: Deletes every records for the given objectIDs. The `chunkedBatch` helper is used under the hood, which creates a `batch` requests with at most 1000 objectIDs in it.
345
+ *
346
+ * @summary Helper: Deletes every records for the given objectIDs. The `chunkedBatch` helper is used under the hood, which creates a `batch` requests with at most 1000 objectIDs in it.
347
+ * @param deleteObjects - The `deleteObjects` object.
348
+ * @param deleteObjects.indexName - The `indexName` to delete `objectIDs` from.
349
+ * @param deleteObjects.objectIDs - The objectIDs to delete.
350
+ * @param requestOptions - The requestOptions to send along with the query, they will be forwarded to the `batch` method and merged with the transporter requestOptions.
351
+ */
352
+ async deleteObjects({ indexName, objectIDs }, requestOptions) {
353
+ return await this.chunkedBatch({
354
+ indexName,
355
+ objects: objectIDs.map((objectID) => ({ objectID })),
356
+ action: 'deleteObject',
357
+ }, requestOptions);
358
+ },
359
+ /**
360
+ * Helper: Replaces object content of all the given objects according to their respective `objectID` field. The `chunkedBatch` helper is used under the hood, which creates a `batch` requests with at most 1000 objects in it.
361
+ *
362
+ * @summary Helper: Replaces object content of all the given objects according to their respective `objectID` field. The `chunkedBatch` helper is used under the hood, which creates a `batch` requests with at most 1000 objects in it.
363
+ * @param partialUpdateObjects - The `partialUpdateObjects` object.
364
+ * @param partialUpdateObjects.indexName - The `indexName` to update `objects` in.
365
+ * @param partialUpdateObjects.objects - The array of `objects` to update in the given Algolia `indexName`.
366
+ * @param partialUpdateObjects.createIfNotExists - To be provided if non-existing objects are passed, otherwise, the call will fail..
367
+ * @param requestOptions - The requestOptions to send along with the query, they will be forwarded to the `getTask` method and merged with the transporter requestOptions.
368
+ */
369
+ async partialUpdateObjects({ indexName, objects, createIfNotExists }, requestOptions) {
370
+ return await this.chunkedBatch({
371
+ indexName,
372
+ objects,
373
+ action: createIfNotExists
374
+ ? 'partialUpdateObject'
375
+ : 'partialUpdateObjectNoCreate',
376
+ }, requestOptions);
377
+ },
378
+ /**
379
+ * 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.
380
+ * See https://api-clients-automation.netlify.app/docs/contributing/add-new-api-client#5-helpers for implementation details.
381
+ *
382
+ * @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.
383
+ * @param replaceAllObjects - The `replaceAllObjects` object.
384
+ * @param replaceAllObjects.indexName - The `indexName` to replace `objects` in.
385
+ * @param replaceAllObjects.objects - The array of `objects` to store in the given Algolia `indexName`.
386
+ * @param replaceAllObjects.batchSize - The size of the chunk of `objects`. The number of `batch` calls will be equal to `objects.length / batchSize`. Defaults to 1000.
387
+ * @param requestOptions - The requestOptions to send along with the query, they will be forwarded to the `batch`, `operationIndex` and `getTask` method and merged with the transporter requestOptions.
388
+ */
389
+ async replaceAllObjects({ indexName, objects, batchSize }, requestOptions) {
390
+ const randomSuffix = Math.floor(Math.random() * 1000000) + 100000;
391
+ const tmpIndexName = `${indexName}_tmp_${randomSuffix}`;
392
+ let copyOperationResponse = await this.operationIndex({
393
+ indexName,
394
+ operationIndexParams: {
395
+ operation: 'copy',
396
+ destination: tmpIndexName,
397
+ scope: ['settings', 'rules', 'synonyms'],
398
+ },
399
+ }, requestOptions);
400
+ const batchResponses = await this.chunkedBatch({ indexName: tmpIndexName, objects, waitForTasks: true, batchSize }, requestOptions);
401
+ await this.waitForTask({
402
+ indexName: tmpIndexName,
403
+ taskID: copyOperationResponse.taskID,
404
+ });
405
+ copyOperationResponse = await this.operationIndex({
406
+ indexName,
407
+ operationIndexParams: {
408
+ operation: 'copy',
409
+ destination: tmpIndexName,
410
+ scope: ['settings', 'rules', 'synonyms'],
411
+ },
412
+ }, requestOptions);
413
+ await this.waitForTask({
414
+ indexName: tmpIndexName,
415
+ taskID: copyOperationResponse.taskID,
416
+ });
417
+ const moveOperationResponse = await this.operationIndex({
418
+ indexName: tmpIndexName,
419
+ operationIndexParams: { operation: 'move', destination: indexName },
420
+ }, requestOptions);
421
+ await this.waitForTask({
422
+ indexName: tmpIndexName,
423
+ taskID: moveOperationResponse.taskID,
424
+ });
425
+ return { copyOperationResponse, batchResponses, moveOperationResponse };
426
+ },
427
+ /**
428
+ * Creates a new API key with specific permissions and restrictions.
429
+ *
430
+ * Required API Key ACLs:
431
+ * - admin.
279
432
  *
280
- * @summary Add API key.
281
433
  * @param apiKey - The apiKey object.
282
434
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
283
435
  */
@@ -301,13 +453,15 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
301
453
  return transporter.request(request, requestOptions);
302
454
  },
303
455
  /**
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).
456
+ * 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).
457
+ *
458
+ * Required API Key ACLs:
459
+ * - addObject.
305
460
  *
306
- * @summary Add or update a record (using objectID).
307
461
  * @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.
462
+ * @param addOrUpdateObject.indexName - Name of the index on which to perform the operation.
463
+ * @param addOrUpdateObject.objectID - Unique record identifier.
464
+ * @param addOrUpdateObject.body - The record, a schemaless object with attributes that are useful in the context of search and discovery.
311
465
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
312
466
  */
313
467
  addOrUpdateObject({ indexName, objectID, body }, requestOptions) {
@@ -335,9 +489,11 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
335
489
  return transporter.request(request, requestOptions);
336
490
  },
337
491
  /**
338
- * Add a source to the list of allowed sources.
492
+ * Adds a source to the list of allowed sources.
493
+ *
494
+ * Required API Key ACLs:
495
+ * - admin.
339
496
  *
340
- * @summary Add a source.
341
497
  * @param source - Source to add.
342
498
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
343
499
  */
@@ -361,11 +517,13 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
361
517
  return transporter.request(request, requestOptions);
362
518
  },
363
519
  /**
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.
520
+ * 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.
521
+ *
522
+ * Required API Key ACLs:
523
+ * - admin.
365
524
  *
366
- * @summary Assign or move a user ID.
367
525
  * @param assignUserId - The assignUserId object.
368
- * @param assignUserId.xAlgoliaUserID - UserID to assign.
526
+ * @param assignUserId.xAlgoliaUserID - Unique identifier of the user who makes the search request.
369
527
  * @param assignUserId.assignUserIdParams - The assignUserIdParams object.
370
528
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
371
529
  */
@@ -395,11 +553,10 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
395
553
  return transporter.request(request, requestOptions);
396
554
  },
397
555
  /**
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.
556
+ * 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
557
  *
400
- * @summary Batch write operations on one index.
401
558
  * @param batch - The batch object.
402
- * @param batch.indexName - Index on which to perform the request.
559
+ * @param batch.indexName - Name of the index on which to perform the operation.
403
560
  * @param batch.batchWriteParams - The batchWriteParams object.
404
561
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
405
562
  */
@@ -426,11 +583,13 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
426
583
  return transporter.request(request, requestOptions);
427
584
  },
428
585
  /**
429
- * Assign multiple user IDs to a cluster. **You can\'t _move_ users with this operation.**.
586
+ * Assigns multiple user IDs to a cluster. **You can\'t move users with this operation**.
587
+ *
588
+ * Required API Key ACLs:
589
+ * - admin.
430
590
  *
431
- * @summary Batch assign userIDs.
432
591
  * @param batchAssignUserIds - The batchAssignUserIds object.
433
- * @param batchAssignUserIds.xAlgoliaUserID - UserID to assign.
592
+ * @param batchAssignUserIds.xAlgoliaUserID - Unique identifier of the user who makes the search request.
434
593
  * @param batchAssignUserIds.batchAssignUserIdsParams - The batchAssignUserIdsParams object.
435
594
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
436
595
  */
@@ -463,11 +622,13 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
463
622
  return transporter.request(request, requestOptions);
464
623
  },
465
624
  /**
466
- * Add or remove a batch of dictionary entries.
625
+ * Adds or deletes multiple entries from your plurals, segmentation, or stop word dictionaries.
626
+ *
627
+ * Required API Key ACLs:
628
+ * - editSettings.
467
629
  *
468
- * @summary Batch dictionary entries.
469
630
  * @param batchDictionaryEntries - The batchDictionaryEntries object.
470
- * @param batchDictionaryEntries.dictionaryName - Dictionary to search in.
631
+ * @param batchDictionaryEntries.dictionaryName - Dictionary type in which to search.
471
632
  * @param batchDictionaryEntries.batchDictionaryEntriesParams - The batchDictionaryEntriesParams object.
472
633
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
473
634
  */
@@ -494,11 +655,13 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
494
655
  return transporter.request(request, requestOptions);
495
656
  },
496
657
  /**
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.
658
+ * Retrieves records from an index, up to 1,000 per request. While searching retrieves _hits_ (records augmented with attributes for highlighting and ranking details), browsing _just_ returns matching records. This can be useful if you want to export your indices. - The Analytics API doesn\'t collect data when using `browse`. - Records are ranked by attributes and custom ranking. - There\'s no ranking for: typo-tolerance, number of matched words, proximity, geo distance. Browse requests automatically apply these settings: - `advancedSyntax`: `false` - `attributesToHighlight`: `[]` - `attributesToSnippet`: `[]` - `distinct`: `false` - `enablePersonalization`: `false` - `enableRules`: `false` - `facets`: `[]` - `getRankingInfo`: `false` - `ignorePlurals`: `false` - `optionalFilters`: `[]` - `typoTolerance`: `true` or `false` (`min` and `strict` is evaluated to `true`) If you send these parameters with your browse requests, they\'ll be ignored.
659
+ *
660
+ * Required API Key ACLs:
661
+ * - browse.
498
662
  *
499
- * @summary Get all records from an index.
500
663
  * @param browse - The browse object.
501
- * @param browse.indexName - Index on which to perform the request.
664
+ * @param browse.indexName - Name of the index on which to perform the operation.
502
665
  * @param browse.browseParams - The browseParams object.
503
666
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
504
667
  */
@@ -519,11 +682,13 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
519
682
  return transporter.request(request, requestOptions);
520
683
  },
521
684
  /**
522
- * Delete the records but leave settings and index-specific API keys untouched.
685
+ * Deletes only the records from an index while keeping settings, synonyms, and rules.
686
+ *
687
+ * Required API Key ACLs:
688
+ * - deleteIndex.
523
689
  *
524
- * @summary Delete all records from an index.
525
690
  * @param clearObjects - The clearObjects object.
526
- * @param clearObjects.indexName - Index on which to perform the request.
691
+ * @param clearObjects.indexName - Name of the index on which to perform the operation.
527
692
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
528
693
  */
529
694
  clearObjects({ indexName }, requestOptions) {
@@ -542,12 +707,14 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
542
707
  return transporter.request(request, requestOptions);
543
708
  },
544
709
  /**
545
- * Delete all rules in the index.
710
+ * Deletes all rules from the index.
711
+ *
712
+ * Required API Key ACLs:
713
+ * - editSettings.
546
714
  *
547
- * @summary Delete all rules.
548
715
  * @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.
716
+ * @param clearRules.indexName - Name of the index on which to perform the operation.
717
+ * @param clearRules.forwardToReplicas - Whether changes are applied to replica indices.
551
718
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
552
719
  */
553
720
  clearRules({ indexName, forwardToReplicas }, requestOptions) {
@@ -569,12 +736,14 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
569
736
  return transporter.request(request, requestOptions);
570
737
  },
571
738
  /**
572
- * Delete all synonyms in the index.
739
+ * Deletes all synonyms from the index.
740
+ *
741
+ * Required API Key ACLs:
742
+ * - editSettings.
573
743
  *
574
- * @summary Delete all synonyms.
575
744
  * @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.
745
+ * @param clearSynonyms.indexName - Name of the index on which to perform the operation.
746
+ * @param clearSynonyms.forwardToReplicas - Whether changes are applied to replica indices.
578
747
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
579
748
  */
580
749
  clearSynonyms({ indexName, forwardToReplicas }, requestOptions) {
@@ -598,7 +767,6 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
598
767
  /**
599
768
  * This method allow you to send requests to the Algolia REST API.
600
769
  *
601
- * @summary Send requests to the Algolia REST API.
602
770
  * @param customDelete - The customDelete object.
603
771
  * @param customDelete.path - Path of the endpoint, anything after \"/1\" must be specified.
604
772
  * @param customDelete.parameters - Query parameters to apply to the current query.
@@ -608,7 +776,7 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
608
776
  if (!path) {
609
777
  throw new Error('Parameter `path` is required when calling `customDelete`.');
610
778
  }
611
- const requestPath = '/1{path}'.replace('{path}', path);
779
+ const requestPath = '/{path}'.replace('{path}', path);
612
780
  const headers = {};
613
781
  const queryParameters = parameters ? parameters : {};
614
782
  const request = {
@@ -622,7 +790,6 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
622
790
  /**
623
791
  * This method allow you to send requests to the Algolia REST API.
624
792
  *
625
- * @summary Send requests to the Algolia REST API.
626
793
  * @param customGet - The customGet object.
627
794
  * @param customGet.path - Path of the endpoint, anything after \"/1\" must be specified.
628
795
  * @param customGet.parameters - Query parameters to apply to the current query.
@@ -632,7 +799,7 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
632
799
  if (!path) {
633
800
  throw new Error('Parameter `path` is required when calling `customGet`.');
634
801
  }
635
- const requestPath = '/1{path}'.replace('{path}', path);
802
+ const requestPath = '/{path}'.replace('{path}', path);
636
803
  const headers = {};
637
804
  const queryParameters = parameters ? parameters : {};
638
805
  const request = {
@@ -646,7 +813,6 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
646
813
  /**
647
814
  * This method allow you to send requests to the Algolia REST API.
648
815
  *
649
- * @summary Send requests to the Algolia REST API.
650
816
  * @param customPost - The customPost object.
651
817
  * @param customPost.path - Path of the endpoint, anything after \"/1\" must be specified.
652
818
  * @param customPost.parameters - Query parameters to apply to the current query.
@@ -657,7 +823,7 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
657
823
  if (!path) {
658
824
  throw new Error('Parameter `path` is required when calling `customPost`.');
659
825
  }
660
- const requestPath = '/1{path}'.replace('{path}', path);
826
+ const requestPath = '/{path}'.replace('{path}', path);
661
827
  const headers = {};
662
828
  const queryParameters = parameters ? parameters : {};
663
829
  const request = {
@@ -672,7 +838,6 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
672
838
  /**
673
839
  * This method allow you to send requests to the Algolia REST API.
674
840
  *
675
- * @summary Send requests to the Algolia REST API.
676
841
  * @param customPut - The customPut object.
677
842
  * @param customPut.path - Path of the endpoint, anything after \"/1\" must be specified.
678
843
  * @param customPut.parameters - Query parameters to apply to the current query.
@@ -683,7 +848,7 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
683
848
  if (!path) {
684
849
  throw new Error('Parameter `path` is required when calling `customPut`.');
685
850
  }
686
- const requestPath = '/1{path}'.replace('{path}', path);
851
+ const requestPath = '/{path}'.replace('{path}', path);
687
852
  const headers = {};
688
853
  const queryParameters = parameters ? parameters : {};
689
854
  const request = {
@@ -696,9 +861,11 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
696
861
  return transporter.request(request, requestOptions);
697
862
  },
698
863
  /**
699
- * Delete an existing API key. The request must be authenticated with the admin API key.
864
+ * Deletes the API key.
865
+ *
866
+ * Required API Key ACLs:
867
+ * - admin.
700
868
  *
701
- * @summary Delete API key.
702
869
  * @param deleteApiKey - The deleteApiKey object.
703
870
  * @param deleteApiKey.key - API key.
704
871
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
@@ -719,11 +886,13 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
719
886
  return transporter.request(request, requestOptions);
720
887
  },
721
888
  /**
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.
889
+ * 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).
890
+ *
891
+ * Required API Key ACLs:
892
+ * - deleteIndex.
723
893
  *
724
- * @summary Delete all records matching a query.
725
894
  * @param deleteBy - The deleteBy object.
726
- * @param deleteBy.indexName - Index on which to perform the request.
895
+ * @param deleteBy.indexName - Name of the index on which to perform the operation.
727
896
  * @param deleteBy.deleteByParams - The deleteByParams object.
728
897
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
729
898
  */
@@ -747,11 +916,13 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
747
916
  return transporter.request(request, requestOptions);
748
917
  },
749
918
  /**
750
- * Delete an existing index.
919
+ * 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/).
920
+ *
921
+ * Required API Key ACLs:
922
+ * - deleteIndex.
751
923
  *
752
- * @summary Delete index.
753
924
  * @param deleteIndex - The deleteIndex object.
754
- * @param deleteIndex.indexName - Index on which to perform the request.
925
+ * @param deleteIndex.indexName - Name of the index on which to perform the operation.
755
926
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
756
927
  */
757
928
  deleteIndex({ indexName }, requestOptions) {
@@ -770,12 +941,14 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
770
941
  return transporter.request(request, requestOptions);
771
942
  },
772
943
  /**
773
- * To delete a set of records matching a query, use the [`deleteByQuery` operation](#tag/Records/operation/deleteBy) instead.
944
+ * 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).
945
+ *
946
+ * Required API Key ACLs:
947
+ * - deleteObject.
774
948
  *
775
- * @summary Delete a record.
776
949
  * @param deleteObject - The deleteObject object.
777
- * @param deleteObject.indexName - Index on which to perform the request.
778
- * @param deleteObject.objectID - Unique record (object) identifier.
950
+ * @param deleteObject.indexName - Name of the index on which to perform the operation.
951
+ * @param deleteObject.objectID - Unique record identifier.
779
952
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
780
953
  */
781
954
  deleteObject({ indexName, objectID }, requestOptions) {
@@ -799,13 +972,15 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
799
972
  return transporter.request(request, requestOptions);
800
973
  },
801
974
  /**
802
- * Delete a rule by its `objectID`. To find the `objectID` for rules, use the [`search` operation](#tag/Rules/operation/searchRules).
975
+ * Deletes a rule by its ID. To find the object ID for rules, use the [`search` operation](#tag/Rules/operation/searchRules).
976
+ *
977
+ * Required API Key ACLs:
978
+ * - editSettings.
803
979
  *
804
- * @summary Delete a rule.
805
980
  * @param deleteRule - The deleteRule object.
806
- * @param deleteRule.indexName - Index on which to perform the request.
981
+ * @param deleteRule.indexName - Name of the index on which to perform the operation.
807
982
  * @param deleteRule.objectID - Unique identifier of a rule object.
808
- * @param deleteRule.forwardToReplicas - Indicates whether changed index settings are forwarded to the replica indices.
983
+ * @param deleteRule.forwardToReplicas - Whether changes are applied to replica indices.
809
984
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
810
985
  */
811
986
  deleteRule({ indexName, objectID, forwardToReplicas }, requestOptions) {
@@ -832,9 +1007,11 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
832
1007
  return transporter.request(request, requestOptions);
833
1008
  },
834
1009
  /**
835
- * Remove a source from the list of allowed sources.
1010
+ * Deletes a source from the list of allowed sources.
1011
+ *
1012
+ * Required API Key ACLs:
1013
+ * - admin.
836
1014
  *
837
- * @summary Remove a source.
838
1015
  * @param deleteSource - The deleteSource object.
839
1016
  * @param deleteSource.source - IP address range of the source.
840
1017
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
@@ -855,13 +1032,15 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
855
1032
  return transporter.request(request, requestOptions);
856
1033
  },
857
1034
  /**
858
- * Delete a synonym by its `objectID`. To find the object IDs of your synonyms, use the [`search` operation](#tag/Synonyms/operation/searchSynonyms).
1035
+ * Deletes a synonym by its ID. To find the object IDs of your synonyms, use the [`search` operation](#tag/Synonyms/operation/searchSynonyms).
1036
+ *
1037
+ * Required API Key ACLs:
1038
+ * - editSettings.
859
1039
  *
860
- * @summary Delete a synonym.
861
1040
  * @param deleteSynonym - The deleteSynonym object.
862
- * @param deleteSynonym.indexName - Index on which to perform the request.
1041
+ * @param deleteSynonym.indexName - Name of the index on which to perform the operation.
863
1042
  * @param deleteSynonym.objectID - Unique identifier of a synonym object.
864
- * @param deleteSynonym.forwardToReplicas - Indicates whether changed index settings are forwarded to the replica indices.
1043
+ * @param deleteSynonym.forwardToReplicas - Whether changes are applied to replica indices.
865
1044
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
866
1045
  */
867
1046
  deleteSynonym({ indexName, objectID, forwardToReplicas }, requestOptions) {
@@ -888,9 +1067,8 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
888
1067
  return transporter.request(request, requestOptions);
889
1068
  },
890
1069
  /**
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.
1070
+ * 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
1071
  *
893
- * @summary Get API key permissions.
894
1072
  * @param getApiKey - The getApiKey object.
895
1073
  * @param getApiKey.key - API key.
896
1074
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
@@ -911,9 +1089,36 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
911
1089
  return transporter.request(request, requestOptions);
912
1090
  },
913
1091
  /**
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.
1092
+ * Checks the status of a given application task.
1093
+ *
1094
+ * Required API Key ACLs:
1095
+ * - editSettings.
1096
+ *
1097
+ * @param getAppTask - The getAppTask object.
1098
+ * @param getAppTask.taskID - Unique task identifier.
1099
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1100
+ */
1101
+ getAppTask({ taskID }, requestOptions) {
1102
+ if (!taskID) {
1103
+ throw new Error('Parameter `taskID` is required when calling `getAppTask`.');
1104
+ }
1105
+ const requestPath = '/1/task/{taskID}'.replace('{taskID}', encodeURIComponent(taskID));
1106
+ const headers = {};
1107
+ const queryParameters = {};
1108
+ const request = {
1109
+ method: 'GET',
1110
+ path: requestPath,
1111
+ queryParameters,
1112
+ headers,
1113
+ };
1114
+ return transporter.request(request, requestOptions);
1115
+ },
1116
+ /**
1117
+ * Lists supported languages with their supported dictionary types and number of custom entries.
1118
+ *
1119
+ * Required API Key ACLs:
1120
+ * - settings.
915
1121
  *
916
- * @summary List available languages.
917
1122
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
918
1123
  */
919
1124
  getDictionaryLanguages(requestOptions) {
@@ -929,9 +1134,11 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
929
1134
  return transporter.request(request, requestOptions);
930
1135
  },
931
1136
  /**
932
- * Get the languages for which [stop words are turned off](#tag/Dictionaries/operation/setDictionarySettings).
1137
+ * Retrieves the languages for which standard dictionary entries are turned off.
1138
+ *
1139
+ * Required API Key ACLs:
1140
+ * - settings.
933
1141
  *
934
- * @summary Get stop word settings.
935
1142
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
936
1143
  */
937
1144
  getDictionarySettings(requestOptions) {
@@ -947,14 +1154,16 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
947
1154
  return transporter.request(request, requestOptions);
948
1155
  },
949
1156
  /**
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).
1157
+ * 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.
1158
+ *
1159
+ * Required API Key ACLs:
1160
+ * - logs.
951
1161
  *
952
- * @summary Return the latest log entries.
953
1162
  * @param getLogs - The getLogs object.
954
- * @param getLogs.offset - First log entry to retrieve. Sorted by decreasing date with 0 being the most recent.
1163
+ * @param getLogs.offset - First log entry to retrieve. The most recent entries are listed first.
955
1164
  * @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.
1165
+ * @param getLogs.indexName - Index for which to retrieve log entries. By default, log entries are retrieved for all indices.
1166
+ * @param getLogs.type - Type of log entries to retrieve. By default, all log entries are retrieved.
958
1167
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
959
1168
  */
960
1169
  getLogs({ offset, length, indexName, type } = {}, requestOptions = undefined) {
@@ -982,13 +1191,15 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
982
1191
  return transporter.request(request, requestOptions);
983
1192
  },
984
1193
  /**
985
- * To get more than one record, use the [`objects` operation](#tag/Records/operation/getObjects).
1194
+ * Retrieves one record by its object ID. To retrieve more than one record, use the [`objects` operation](#tag/Records/operation/getObjects).
1195
+ *
1196
+ * Required API Key ACLs:
1197
+ * - search.
986
1198
  *
987
- * @summary Get a record.
988
1199
  * @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.
1200
+ * @param getObject.indexName - Name of the index on which to perform the operation.
1201
+ * @param getObject.objectID - Unique record identifier.
1202
+ * @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
1203
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
993
1204
  */
994
1205
  getObject({ indexName, objectID, attributesToRetrieve }, requestOptions) {
@@ -1015,9 +1226,11 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
1015
1226
  return transporter.request(request, requestOptions);
1016
1227
  },
1017
1228
  /**
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.
1229
+ * Retrieves one or more records, potentially from different indices. Records are returned in the same order as the requests.
1230
+ *
1231
+ * Required API Key ACLs:
1232
+ * - search.
1019
1233
  *
1020
- * @summary Get multiple records.
1021
1234
  * @param getObjectsParams - Request object.
1022
1235
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1023
1236
  */
@@ -1043,11 +1256,13 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
1043
1256
  return transporter.request(request, requestOptions);
1044
1257
  },
1045
1258
  /**
1046
- * Get a rule by its `objectID`. To find the `objectID` for rules, use the [`search` operation](#tag/Rules/operation/searchRules).
1259
+ * Retrieves a rule by its ID. To find the object ID of rules, use the [`search` operation](#tag/Rules/operation/searchRules).
1260
+ *
1261
+ * Required API Key ACLs:
1262
+ * - settings.
1047
1263
  *
1048
- * @summary Get a rule.
1049
1264
  * @param getRule - The getRule object.
1050
- * @param getRule.indexName - Index on which to perform the request.
1265
+ * @param getRule.indexName - Name of the index on which to perform the operation.
1051
1266
  * @param getRule.objectID - Unique identifier of a rule object.
1052
1267
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1053
1268
  */
@@ -1072,11 +1287,13 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
1072
1287
  return transporter.request(request, requestOptions);
1073
1288
  },
1074
1289
  /**
1075
- * Return an object containing an index\'s [configuration settings](https://www.algolia.com/doc/api-reference/settings-api-parameters/).
1290
+ * Retrieves an object with non-null index settings.
1291
+ *
1292
+ * Required API Key ACLs:
1293
+ * - search.
1076
1294
  *
1077
- * @summary Get index settings.
1078
1295
  * @param getSettings - The getSettings object.
1079
- * @param getSettings.indexName - Index on which to perform the request.
1296
+ * @param getSettings.indexName - Name of the index on which to perform the operation.
1080
1297
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1081
1298
  */
1082
1299
  getSettings({ indexName }, requestOptions) {
@@ -1095,9 +1312,11 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
1095
1312
  return transporter.request(request, requestOptions);
1096
1313
  },
1097
1314
  /**
1098
- * Get all allowed sources (IP addresses).
1315
+ * Retrieves all allowed IP addresses with access to your application.
1316
+ *
1317
+ * Required API Key ACLs:
1318
+ * - admin.
1099
1319
  *
1100
- * @summary Get all allowed IP addresses.
1101
1320
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1102
1321
  */
1103
1322
  getSources(requestOptions) {
@@ -1113,11 +1332,13 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
1113
1332
  return transporter.request(request, requestOptions);
1114
1333
  },
1115
1334
  /**
1116
- * Get a syonym by its `objectID`. To find the object IDs for your synonyms, use the [`search` operation](#tag/Synonyms/operation/searchSynonyms).
1335
+ * Retrieves a syonym by its ID. To find the object IDs for your synonyms, use the [`search` operation](#tag/Synonyms/operation/searchSynonyms).
1336
+ *
1337
+ * Required API Key ACLs:
1338
+ * - settings.
1117
1339
  *
1118
- * @summary Get a synonym object.
1119
1340
  * @param getSynonym - The getSynonym object.
1120
- * @param getSynonym.indexName - Index on which to perform the request.
1341
+ * @param getSynonym.indexName - Name of the index on which to perform the operation.
1121
1342
  * @param getSynonym.objectID - Unique identifier of a synonym object.
1122
1343
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1123
1344
  */
@@ -1142,11 +1363,13 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
1142
1363
  return transporter.request(request, requestOptions);
1143
1364
  },
1144
1365
  /**
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.
1366
+ * 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.
1367
+ *
1368
+ * Required API Key ACLs:
1369
+ * - addObject.
1146
1370
  *
1147
- * @summary Check a task\'s status.
1148
1371
  * @param getTask - The getTask object.
1149
- * @param getTask.indexName - Index on which to perform the request.
1372
+ * @param getTask.indexName - Name of the index on which to perform the operation.
1150
1373
  * @param getTask.taskID - Unique task identifier.
1151
1374
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1152
1375
  */
@@ -1171,9 +1394,11 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
1171
1394
  return transporter.request(request, requestOptions);
1172
1395
  },
1173
1396
  /**
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.
1397
+ * 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.
1398
+ *
1399
+ * Required API Key ACLs:
1400
+ * - admin.
1175
1401
  *
1176
- * @summary Get top userID.
1177
1402
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1178
1403
  */
1179
1404
  getTopUserIds(requestOptions) {
@@ -1189,11 +1414,13 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
1189
1414
  return transporter.request(request, requestOptions);
1190
1415
  },
1191
1416
  /**
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.
1417
+ * 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.
1418
+ *
1419
+ * Required API Key ACLs:
1420
+ * - admin.
1193
1421
  *
1194
- * @summary Get userID.
1195
1422
  * @param getUserId - The getUserId object.
1196
- * @param getUserId.userID - UserID to assign.
1423
+ * @param getUserId.userID - Unique identifier of the user who makes the search request.
1197
1424
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1198
1425
  */
1199
1426
  getUserId({ userID }, requestOptions) {
@@ -1214,9 +1441,11 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
1214
1441
  /**
1215
1442
  * 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
1443
  *
1217
- * @summary Get migration and user mapping status.
1444
+ * Required API Key ACLs:
1445
+ * - admin.
1446
+ *
1218
1447
  * @param hasPendingMappings - The hasPendingMappings object.
1219
- * @param hasPendingMappings.getClusters - Indicates whether to include the cluster\'s pending mapping state in the response.
1448
+ * @param hasPendingMappings.getClusters - Whether to include the cluster\'s pending mapping state in the response.
1220
1449
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1221
1450
  */
1222
1451
  hasPendingMappings({ getClusters } = {}, requestOptions = undefined) {
@@ -1235,9 +1464,11 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
1235
1464
  return transporter.request(request, requestOptions);
1236
1465
  },
1237
1466
  /**
1238
- * List all API keys associated with your Algolia application, including their permissions and restrictions.
1467
+ * Lists all API keys associated with your Algolia application, including their permissions and restrictions.
1468
+ *
1469
+ * Required API Key ACLs:
1470
+ * - admin.
1239
1471
  *
1240
- * @summary List API keys.
1241
1472
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1242
1473
  */
1243
1474
  listApiKeys(requestOptions) {
@@ -1253,9 +1484,11 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
1253
1484
  return transporter.request(request, requestOptions);
1254
1485
  },
1255
1486
  /**
1256
- * List the available clusters in a multi-cluster setup.
1487
+ * Lists the available clusters in a multi-cluster setup.
1488
+ *
1489
+ * Required API Key ACLs:
1490
+ * - admin.
1257
1491
  *
1258
- * @summary List clusters.
1259
1492
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1260
1493
  */
1261
1494
  listClusters(requestOptions) {
@@ -1271,12 +1504,14 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
1271
1504
  return transporter.request(request, requestOptions);
1272
1505
  },
1273
1506
  /**
1274
- * List indices in an Algolia application.
1507
+ * Lists all indices in the current Algolia application. The request follows any index restrictions of the API key you use to make the request.
1508
+ *
1509
+ * Required API Key ACLs:
1510
+ * - listIndexes.
1275
1511
  *
1276
- * @summary List indices.
1277
1512
  * @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.
1513
+ * @param listIndices.page - Requested page of the API response. If `null`, the API response is not paginated.
1514
+ * @param listIndices.hitsPerPage - Number of hits per page.
1280
1515
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1281
1516
  */
1282
1517
  listIndices({ page, hitsPerPage } = {}, requestOptions = undefined) {
@@ -1298,12 +1533,14 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
1298
1533
  return transporter.request(request, requestOptions);
1299
1534
  },
1300
1535
  /**
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.
1536
+ * 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.
1537
+ *
1538
+ * Required API Key ACLs:
1539
+ * - admin.
1302
1540
  *
1303
- * @summary List userIDs.
1304
1541
  * @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.
1542
+ * @param listUserIds.page - Requested page of the API response. If `null`, the API response is not paginated.
1543
+ * @param listUserIds.hitsPerPage - Number of hits per page.
1307
1544
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1308
1545
  */
1309
1546
  listUserIds({ page, hitsPerPage } = {}, requestOptions = undefined) {
@@ -1325,9 +1562,8 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
1325
1562
  return transporter.request(request, requestOptions);
1326
1563
  },
1327
1564
  /**
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.
1565
+ * 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
1566
  *
1330
- * @summary Batch write operations on multiple indices.
1331
1567
  * @param batchParams - The batchParams object.
1332
1568
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1333
1569
  */
@@ -1351,11 +1587,13 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
1351
1587
  return transporter.request(request, requestOptions);
1352
1588
  },
1353
1589
  /**
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/).
1590
+ * Copies or moves (renames) an index within the same Algolia application. - Existing destination indices are overwritten, except for their analytics data. - If the destination index doesn\'t exist yet, it\'ll be created. **Copy** - Copying a source index that doesn\'t exist creates a new index with 0 records and default settings. - The API keys of the source index are merged with the existing keys in the destination index. - You can\'t copy the `enableReRanking`, `mode`, and `replicas` settings. - You can\'t copy to a destination index that already has replicas. - Be aware of the [size limits](https://www.algolia.com/doc/guides/scaling/algolia-service-limits/#application-record-and-index-limits). - Related guide: [Copy indices](https://www.algolia.com/doc/guides/sending-and-managing-data/manage-indices-and-apps/manage-indices/how-to/copy-indices/) **Move** - Moving a source index that doesn\'t exist is ignored without returning an error. - When moving an index, the analytics data keep their original name and a new set of analytics data is started for the new name. To access the original analytics in the dashboard, create an index with the original name. - If the destination index has replicas, moving will overwrite the existing index and copy the data to the replica indices. - Related guide: [Move indices](https://www.algolia.com/doc/guides/sending-and-managing-data/manage-indices-and-apps/manage-indices/how-to/move-indices/).
1591
+ *
1592
+ * Required API Key ACLs:
1593
+ * - addObject.
1355
1594
  *
1356
- * @summary Copy, move, or rename an index.
1357
1595
  * @param operationIndex - The operationIndex object.
1358
- * @param operationIndex.indexName - Index on which to perform the request.
1596
+ * @param operationIndex.indexName - Name of the index on which to perform the operation.
1359
1597
  * @param operationIndex.operationIndexParams - The operationIndexParams object.
1360
1598
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1361
1599
  */
@@ -1385,14 +1623,16 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
1385
1623
  return transporter.request(request, requestOptions);
1386
1624
  },
1387
1625
  /**
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.
1626
+ * 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.
1627
+ *
1628
+ * Required API Key ACLs:
1629
+ * - addObject.
1389
1630
  *
1390
- * @summary Update record attributes.
1391
1631
  * @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.
1632
+ * @param partialUpdateObject.indexName - Name of the index on which to perform the operation.
1633
+ * @param partialUpdateObject.objectID - Unique record identifier.
1634
+ * @param partialUpdateObject.attributesToUpdate - Attributes with their values.
1635
+ * @param partialUpdateObject.createIfNotExists - Whether to create a new record if it doesn\'t exist.
1396
1636
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1397
1637
  */
1398
1638
  partialUpdateObject({ indexName, objectID, attributesToUpdate, createIfNotExists, }, requestOptions) {
@@ -1423,11 +1663,13 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
1423
1663
  return transporter.request(request, requestOptions);
1424
1664
  },
1425
1665
  /**
1426
- * Remove a userID and its associated data from the multi-clusters.
1666
+ * Deletes a user ID and its associated data from the clusters.
1667
+ *
1668
+ * Required API Key ACLs:
1669
+ * - admin.
1427
1670
  *
1428
- * @summary Remove userID.
1429
1671
  * @param removeUserId - The removeUserId object.
1430
- * @param removeUserId.userID - UserID to assign.
1672
+ * @param removeUserId.userID - Unique identifier of the user who makes the search request.
1431
1673
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1432
1674
  */
1433
1675
  removeUserId({ userID }, requestOptions) {
@@ -1446,9 +1688,11 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
1446
1688
  return transporter.request(request, requestOptions);
1447
1689
  },
1448
1690
  /**
1449
- * Replace all allowed sources.
1691
+ * Replaces the list of allowed sources.
1692
+ *
1693
+ * Required API Key ACLs:
1694
+ * - admin.
1450
1695
  *
1451
- * @summary Replace all sources.
1452
1696
  * @param replaceSources - The replaceSources object.
1453
1697
  * @param replaceSources.source - Allowed sources.
1454
1698
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
@@ -1470,9 +1714,11 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
1470
1714
  return transporter.request(request, requestOptions);
1471
1715
  },
1472
1716
  /**
1473
- * Restore a deleted API key, along with its associated permissions. The request must be authenticated with the admin API key.
1717
+ * 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.
1718
+ *
1719
+ * Required API Key ACLs:
1720
+ * - admin.
1474
1721
  *
1475
- * @summary Restore API key.
1476
1722
  * @param restoreApiKey - The restoreApiKey object.
1477
1723
  * @param restoreApiKey.key - API key.
1478
1724
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
@@ -1493,12 +1739,14 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
1493
1739
  return transporter.request(request, requestOptions);
1494
1740
  },
1495
1741
  /**
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).
1742
+ * 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).
1743
+ *
1744
+ * Required API Key ACLs:
1745
+ * - addObject.
1497
1746
  *
1498
- * @summary Add or update a record.
1499
1747
  * @param saveObject - The saveObject object.
1500
- * @param saveObject.indexName - Index on which to perform the request.
1501
- * @param saveObject.body - The Algolia record.
1748
+ * @param saveObject.indexName - Name of the index on which to perform the operation.
1749
+ * @param saveObject.body - The record, a schemaless object with attributes that are useful in the context of search and discovery.
1502
1750
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1503
1751
  */
1504
1752
  saveObject({ indexName, body }, requestOptions) {
@@ -1521,14 +1769,16 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
1521
1769
  return transporter.request(request, requestOptions);
1522
1770
  },
1523
1771
  /**
1524
- * To create or update more than one rule, use the [`batch` operation](#tag/Rules/operation/saveRules).
1772
+ * 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).
1773
+ *
1774
+ * Required API Key ACLs:
1775
+ * - editSettings.
1525
1776
  *
1526
- * @summary Create or update a rule.
1527
1777
  * @param saveRule - The saveRule object.
1528
- * @param saveRule.indexName - Index on which to perform the request.
1778
+ * @param saveRule.indexName - Name of the index on which to perform the operation.
1529
1779
  * @param saveRule.objectID - Unique identifier of a rule object.
1530
1780
  * @param saveRule.rule - The rule object.
1531
- * @param saveRule.forwardToReplicas - Indicates whether changed index settings are forwarded to the replica indices.
1781
+ * @param saveRule.forwardToReplicas - Whether changes are applied to replica indices.
1532
1782
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1533
1783
  */
1534
1784
  saveRule({ indexName, objectID, rule, forwardToReplicas }, requestOptions) {
@@ -1562,14 +1812,16 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
1562
1812
  return transporter.request(request, requestOptions);
1563
1813
  },
1564
1814
  /**
1565
- * Create or update multiple rules.
1815
+ * 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.
1816
+ *
1817
+ * Required API Key ACLs:
1818
+ * - editSettings.
1566
1819
  *
1567
- * @summary Save a batch of rules.
1568
1820
  * @param saveRules - The saveRules object.
1569
- * @param saveRules.indexName - Index on which to perform the request.
1821
+ * @param saveRules.indexName - Name of the index on which to perform the operation.
1570
1822
  * @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.
1823
+ * @param saveRules.forwardToReplicas - Whether changes are applied to replica indices.
1824
+ * @param saveRules.clearExistingRules - Whether existing rules should be deleted before adding this batch.
1573
1825
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1574
1826
  */
1575
1827
  saveRules({ indexName, rules, forwardToReplicas, clearExistingRules, }, requestOptions) {
@@ -1598,14 +1850,16 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
1598
1850
  return transporter.request(request, requestOptions);
1599
1851
  },
1600
1852
  /**
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).
1853
+ * 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).
1854
+ *
1855
+ * Required API Key ACLs:
1856
+ * - editSettings.
1602
1857
  *
1603
- * @summary Save a synonym.
1604
1858
  * @param saveSynonym - The saveSynonym object.
1605
- * @param saveSynonym.indexName - Index on which to perform the request.
1859
+ * @param saveSynonym.indexName - Name of the index on which to perform the operation.
1606
1860
  * @param saveSynonym.objectID - Unique identifier of a synonym object.
1607
1861
  * @param saveSynonym.synonymHit - The synonymHit object.
1608
- * @param saveSynonym.forwardToReplicas - Indicates whether changed index settings are forwarded to the replica indices.
1862
+ * @param saveSynonym.forwardToReplicas - Whether changes are applied to replica indices.
1609
1863
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1610
1864
  */
1611
1865
  saveSynonym({ indexName, objectID, synonymHit, forwardToReplicas }, requestOptions) {
@@ -1642,14 +1896,16 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
1642
1896
  return transporter.request(request, requestOptions);
1643
1897
  },
1644
1898
  /**
1645
- * Create or update multiple synonyms.
1899
+ * If a synonym with the `objectID` doesn\'t exist, Algolia adds a new one. Otherwise, existing synonyms are replaced.
1900
+ *
1901
+ * Required API Key ACLs:
1902
+ * - editSettings.
1646
1903
  *
1647
- * @summary Save a batch of synonyms.
1648
1904
  * @param saveSynonyms - The saveSynonyms object.
1649
- * @param saveSynonyms.indexName - Index on which to perform the request.
1905
+ * @param saveSynonyms.indexName - Name of the index on which to perform the operation.
1650
1906
  * @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.
1907
+ * @param saveSynonyms.forwardToReplicas - Whether changes are applied to replica indices.
1908
+ * @param saveSynonyms.replaceExistingSynonyms - Whether to replace all synonyms in the index with the ones sent with this request.
1653
1909
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1654
1910
  */
1655
1911
  saveSynonyms({ indexName, synonymHit, forwardToReplicas, replaceExistingSynonyms, }, requestOptions) {
@@ -1679,10 +1935,12 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
1679
1935
  return transporter.request(request, requestOptions);
1680
1936
  },
1681
1937
  /**
1682
- * Send multiple search queries to one or more indices.
1938
+ * 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
1939
  *
1684
- * @summary Search multiple indices.
1685
- * @param searchMethodParams - Query requests and strategies. Results will be received in the same order as the queries.
1940
+ * Required API Key ACLs:
1941
+ * - search.
1942
+ *
1943
+ * @param searchMethodParams - Muli-search request body. Results are returned in the same order as the requests.
1686
1944
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1687
1945
  */
1688
1946
  search(searchMethodParams, requestOptions) {
@@ -1729,11 +1987,13 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
1729
1987
  return transporter.request(request, requestOptions);
1730
1988
  },
1731
1989
  /**
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.
1990
+ * Searches for standard and custom dictionary entries.
1991
+ *
1992
+ * Required API Key ACLs:
1993
+ * - settings.
1733
1994
  *
1734
- * @summary Search dictionary entries.
1735
1995
  * @param searchDictionaryEntries - The searchDictionaryEntries object.
1736
- * @param searchDictionaryEntries.dictionaryName - Dictionary to search in.
1996
+ * @param searchDictionaryEntries.dictionaryName - Dictionary type in which to search.
1737
1997
  * @param searchDictionaryEntries.searchDictionaryEntriesParams - The searchDictionaryEntriesParams object.
1738
1998
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1739
1999
  */
@@ -1762,12 +2022,14 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
1762
2022
  return transporter.request(request, requestOptions);
1763
2023
  },
1764
2024
  /**
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`.
2025
+ * 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**.
2026
+ *
2027
+ * Required API Key ACLs:
2028
+ * - search.
1766
2029
  *
1767
- * @summary Search for facet values.
1768
2030
  * @param searchForFacetValues - The searchForFacetValues object.
1769
- * @param searchForFacetValues.indexName - Index on which to perform the request.
1770
- * @param searchForFacetValues.facetName - Facet name.
2031
+ * @param searchForFacetValues.indexName - Name of the index on which to perform the operation.
2032
+ * @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
2033
  * @param searchForFacetValues.searchForFacetValuesRequest - The searchForFacetValuesRequest object.
1772
2034
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1773
2035
  */
@@ -1795,11 +2057,13 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
1795
2057
  return transporter.request(request, requestOptions);
1796
2058
  },
1797
2059
  /**
1798
- * Search for rules in your index. You can control the search with parameters. To list all rules, send an empty request body.
2060
+ * Searches for rules in your index.
2061
+ *
2062
+ * Required API Key ACLs:
2063
+ * - settings.
1799
2064
  *
1800
- * @summary Search for rules.
1801
2065
  * @param searchRules - The searchRules object.
1802
- * @param searchRules.indexName - Index on which to perform the request.
2066
+ * @param searchRules.indexName - Name of the index on which to perform the operation.
1803
2067
  * @param searchRules.searchRulesParams - The searchRulesParams object.
1804
2068
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1805
2069
  */
@@ -1822,11 +2086,13 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
1822
2086
  return transporter.request(request, requestOptions);
1823
2087
  },
1824
2088
  /**
1825
- * Return records that match the query.
2089
+ * 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.
2090
+ *
2091
+ * Required API Key ACLs:
2092
+ * - search.
1826
2093
  *
1827
- * @summary Search an index.
1828
2094
  * @param searchSingleIndex - The searchSingleIndex object.
1829
- * @param searchSingleIndex.indexName - Index on which to perform the request.
2095
+ * @param searchSingleIndex.indexName - Name of the index on which to perform the operation.
1830
2096
  * @param searchSingleIndex.searchParams - The searchParams object.
1831
2097
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1832
2098
  */
@@ -1849,11 +2115,13 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
1849
2115
  return transporter.request(request, requestOptions);
1850
2116
  },
1851
2117
  /**
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.
2118
+ * Searches for synonyms in your index.
2119
+ *
2120
+ * Required API Key ACLs:
2121
+ * - settings.
1853
2122
  *
1854
- * @summary Search for synonyms.
1855
2123
  * @param searchSynonyms - The searchSynonyms object.
1856
- * @param searchSynonyms.indexName - Index on which to perform the request.
2124
+ * @param searchSynonyms.indexName - Name of the index on which to perform the operation.
1857
2125
  * @param searchSynonyms.searchSynonymsParams - Body of the `searchSynonyms` operation.
1858
2126
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1859
2127
  */
@@ -1876,9 +2144,11 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
1876
2144
  return transporter.request(request, requestOptions);
1877
2145
  },
1878
2146
  /**
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).
2147
+ * 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).
2148
+ *
2149
+ * Required API Key ACLs:
2150
+ * - admin.
1880
2151
  *
1881
- * @summary Search for a user ID.
1882
2152
  * @param searchUserIdsParams - The searchUserIdsParams object.
1883
2153
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1884
2154
  */
@@ -1904,9 +2174,11 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
1904
2174
  return transporter.request(request, requestOptions);
1905
2175
  },
1906
2176
  /**
1907
- * Set stop word settings for a specific language.
2177
+ * Turns standard stop word dictionary entries on or off for a given language.
2178
+ *
2179
+ * Required API Key ACLs:
2180
+ * - editSettings.
1908
2181
  *
1909
- * @summary Set stop word settings.
1910
2182
  * @param dictionarySettingsParams - The dictionarySettingsParams object.
1911
2183
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1912
2184
  */
@@ -1930,13 +2202,15 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
1930
2202
  return transporter.request(request, requestOptions);
1931
2203
  },
1932
2204
  /**
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.
2205
+ * 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.
2206
+ *
2207
+ * Required API Key ACLs:
2208
+ * - editSettings.
1934
2209
  *
1935
- * @summary Update index settings.
1936
2210
  * @param setSettings - The setSettings object.
1937
- * @param setSettings.indexName - Index on which to perform the request.
2211
+ * @param setSettings.indexName - Name of the index on which to perform the operation.
1938
2212
  * @param setSettings.indexSettings - The indexSettings object.
1939
- * @param setSettings.forwardToReplicas - Indicates whether changed index settings are forwarded to the replica indices.
2213
+ * @param setSettings.forwardToReplicas - Whether changes are applied to replica indices.
1940
2214
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1941
2215
  */
1942
2216
  setSettings({ indexName, indexSettings, forwardToReplicas }, requestOptions) {
@@ -1962,9 +2236,11 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
1962
2236
  return transporter.request(request, requestOptions);
1963
2237
  },
1964
2238
  /**
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.
2239
+ * Replaces the permissions of an existing API key. Any unspecified attribute resets that attribute to its default value.
2240
+ *
2241
+ * Required API Key ACLs:
2242
+ * - admin.
1966
2243
  *
1967
- * @summary Update an API key.
1968
2244
  * @param updateApiKey - The updateApiKey object.
1969
2245
  * @param updateApiKey.key - API key.
1970
2246
  * @param updateApiKey.apiKey - The apiKey object.
@@ -1996,6 +2272,7 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
1996
2272
  }
1997
2273
 
1998
2274
  // 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.
2275
+ // eslint-disable-next-line @typescript-eslint/explicit-function-return-type
1999
2276
  function searchClient(appId, apiKey, options) {
2000
2277
  if (!appId || typeof appId !== 'string') {
2001
2278
  throw new Error('`appId` is missing.');
@@ -2003,21 +2280,69 @@ function searchClient(appId, apiKey, options) {
2003
2280
  if (!apiKey || typeof apiKey !== 'string') {
2004
2281
  throw new Error('`apiKey` is missing.');
2005
2282
  }
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
- });
2283
+ return {
2284
+ ...createSearchClient({
2285
+ appId,
2286
+ apiKey,
2287
+ timeouts: {
2288
+ connect: DEFAULT_CONNECT_TIMEOUT_NODE,
2289
+ read: DEFAULT_READ_TIMEOUT_NODE,
2290
+ write: DEFAULT_WRITE_TIMEOUT_NODE,
2291
+ },
2292
+ requester: createHttpRequester(),
2293
+ algoliaAgents: [{ segment: 'Node.js', version: process.versions.node }],
2294
+ responsesCache: createNullCache(),
2295
+ requestsCache: createNullCache(),
2296
+ hostsCache: createMemoryCache(),
2297
+ ...options,
2298
+ }),
2299
+ /**
2300
+ * Helper: Generates a secured API key based on the given `parentApiKey` and given `restrictions`.
2301
+ *
2302
+ * @summary Helper: Generates a secured API key based on the given `parentApiKey` and given `restrictions`.
2303
+ * @param generateSecuredApiKey - The `generateSecuredApiKey` object.
2304
+ * @param generateSecuredApiKey.parentApiKey - The base API key from which to generate the new secured one.
2305
+ * @param generateSecuredApiKey.restrictions - A set of properties defining the restrictions of the secured API key.
2306
+ */
2307
+ generateSecuredApiKey({ parentApiKey, restrictions = {}, }) {
2308
+ let mergedRestrictions = restrictions;
2309
+ if (restrictions.searchParams) {
2310
+ // merge searchParams with the root restrictions
2311
+ mergedRestrictions = {
2312
+ ...restrictions,
2313
+ ...restrictions.searchParams,
2314
+ };
2315
+ delete mergedRestrictions.searchParams;
2316
+ }
2317
+ mergedRestrictions = Object.keys(mergedRestrictions)
2318
+ .sort()
2319
+ .reduce((acc, key) => {
2320
+ // eslint-disable-next-line no-param-reassign
2321
+ acc[key] = mergedRestrictions[key];
2322
+ return acc;
2323
+ }, {});
2324
+ const queryParameters = serializeQueryParameters(mergedRestrictions);
2325
+ return Buffer.from(createHmac('sha256', parentApiKey)
2326
+ .update(queryParameters)
2327
+ .digest('hex') + queryParameters).toString('base64');
2328
+ },
2329
+ /**
2330
+ * Helper: Retrieves the remaining validity of the previous generated `securedApiKey`, the `ValidUntil` parameter must have been provided.
2331
+ *
2332
+ * @summary Helper: Retrieves the remaining validity of the previous generated `secured_api_key`, the `ValidUntil` parameter must have been provided.
2333
+ * @param getSecuredApiKeyRemainingValidity - The `getSecuredApiKeyRemainingValidity` object.
2334
+ * @param getSecuredApiKeyRemainingValidity.securedApiKey - The secured API key generated with the `generateSecuredApiKey` method.
2335
+ */
2336
+ getSecuredApiKeyRemainingValidity({ securedApiKey, }) {
2337
+ const decodedString = Buffer.from(securedApiKey, 'base64').toString('ascii');
2338
+ const regex = /validUntil=(\d+)/;
2339
+ const match = decodedString.match(regex);
2340
+ if (match === null) {
2341
+ throw new Error('validUntil not found in given secured api key.');
2342
+ }
2343
+ return parseInt(match[1], 10) - Math.round(new Date().getTime() / 1000);
2344
+ },
2345
+ };
2021
2346
  }
2022
2347
 
2023
2348
  export { apiClientVersion, searchClient };