@algolia/client-search 5.50.1 → 5.51.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -31,7 +31,7 @@ var import_requester_node_http = require("@algolia/requester-node-http");
31
31
 
32
32
  // src/searchClient.ts
33
33
  var import_client_common = require("@algolia/client-common");
34
- var apiClientVersion = "5.50.1";
34
+ var apiClientVersion = "5.51.0";
35
35
  function getDefaultHosts(appId) {
36
36
  return [
37
37
  {
@@ -141,14 +141,14 @@ function createSearchClient({
141
141
  * @param waitForTaskOptions - The `waitForTaskOptions` object.
142
142
  * @param waitForTaskOptions.indexName - The `indexName` where the operation was performed.
143
143
  * @param waitForTaskOptions.taskID - The `taskID` returned in the method response.
144
- * @param waitForTaskOptions.maxRetries - The maximum number of retries. 50 by default.
144
+ * @param waitForTaskOptions.maxRetries - The maximum number of retries. 100 by default.
145
145
  * @param waitForTaskOptions.timeout - The function to decide how long to wait between retries.
146
146
  * @param requestOptions - The requestOptions to send along with the query, they will be forwarded to the `getTask` method and merged with the transporter requestOptions.
147
147
  */
148
148
  waitForTask({
149
149
  indexName,
150
150
  taskID,
151
- maxRetries = 50,
151
+ maxRetries = 100,
152
152
  timeout = (retryCount) => Math.min(retryCount * 200, 5e3)
153
153
  }, requestOptions) {
154
154
  let retryCount = 0;
@@ -158,7 +158,7 @@ function createSearchClient({
158
158
  aggregator: () => retryCount += 1,
159
159
  error: {
160
160
  validate: () => retryCount >= maxRetries,
161
- message: () => `The maximum number of retries exceeded. (${retryCount}/${maxRetries})`
161
+ message: () => `Stopped waiting for the task after ${maxRetries} retries. This does not mean the operation failed; it may still complete. If you need to keep polling, retry with a higher maxRetries.`
162
162
  },
163
163
  timeout: () => timeout(retryCount)
164
164
  });
@@ -169,13 +169,13 @@ function createSearchClient({
169
169
  * @summary Helper method that waits for a task to be published (completed).
170
170
  * @param waitForAppTaskOptions - The `waitForTaskOptions` object.
171
171
  * @param waitForAppTaskOptions.taskID - The `taskID` returned in the method response.
172
- * @param waitForAppTaskOptions.maxRetries - The maximum number of retries. 50 by default.
172
+ * @param waitForAppTaskOptions.maxRetries - The maximum number of retries. 100 by default.
173
173
  * @param waitForAppTaskOptions.timeout - The function to decide how long to wait between retries.
174
174
  * @param requestOptions - The requestOptions to send along with the query, they will be forwarded to the `getTask` method and merged with the transporter requestOptions.
175
175
  */
176
176
  waitForAppTask({
177
177
  taskID,
178
- maxRetries = 50,
178
+ maxRetries = 100,
179
179
  timeout = (retryCount) => Math.min(retryCount * 200, 5e3)
180
180
  }, requestOptions) {
181
181
  let retryCount = 0;
@@ -185,7 +185,7 @@ function createSearchClient({
185
185
  aggregator: () => retryCount += 1,
186
186
  error: {
187
187
  validate: () => retryCount >= maxRetries,
188
- message: () => `The maximum number of retries exceeded. (${retryCount}/${maxRetries})`
188
+ message: () => `Stopped waiting for the task after ${maxRetries} retries. This does not mean the operation failed; it may still complete. If you need to keep polling, retry with a higher maxRetries.`
189
189
  },
190
190
  timeout: () => timeout(retryCount)
191
191
  });
@@ -198,7 +198,7 @@ function createSearchClient({
198
198
  * @param waitForApiKeyOptions.operation - The `operation` that was done on a `key`.
199
199
  * @param waitForApiKeyOptions.key - The `key` that has been added, deleted or updated.
200
200
  * @param waitForApiKeyOptions.apiKey - Necessary to know if an `update` operation has been processed, compare fields of the response with it.
201
- * @param waitForApiKeyOptions.maxRetries - The maximum number of retries. 50 by default.
201
+ * @param waitForApiKeyOptions.maxRetries - The maximum number of retries. 100 by default.
202
202
  * @param waitForApiKeyOptions.timeout - The function to decide how long to wait between retries.
203
203
  * @param requestOptions - The requestOptions to send along with the query, they will be forwarded to the `getApikey` method and merged with the transporter requestOptions.
204
204
  */
@@ -206,7 +206,7 @@ function createSearchClient({
206
206
  operation,
207
207
  key,
208
208
  apiKey,
209
- maxRetries = 50,
209
+ maxRetries = 100,
210
210
  timeout = (retryCount) => Math.min(retryCount * 200, 5e3)
211
211
  }, requestOptions) {
212
212
  let retryCount = 0;
@@ -214,7 +214,7 @@ function createSearchClient({
214
214
  aggregator: () => retryCount += 1,
215
215
  error: {
216
216
  validate: () => retryCount >= maxRetries,
217
- message: () => `The maximum number of retries exceeded. (${retryCount}/${maxRetries})`
217
+ message: () => `Stopped waiting for the API key operation after ${maxRetries} retries. This does not mean the operation failed; it may still complete. If you need to keep polling, retry with a higher maxRetries.`
218
218
  },
219
219
  timeout: () => timeout(retryCount)
220
220
  };