@algolia/client-search 5.50.2 → 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.
- package/README.md +4 -4
- package/dist/browser.d.ts +113 -6
- package/dist/builds/browser.js +10 -10
- package/dist/builds/browser.js.map +1 -1
- package/dist/builds/browser.min.js +1 -1
- package/dist/builds/browser.min.js.map +1 -1
- package/dist/builds/browser.umd.js +2 -2
- package/dist/builds/fetch.js +10 -10
- package/dist/builds/fetch.js.map +1 -1
- package/dist/builds/node.cjs +10 -10
- package/dist/builds/node.cjs.map +1 -1
- package/dist/builds/node.js +10 -10
- package/dist/builds/node.js.map +1 -1
- package/dist/builds/worker.js +10 -10
- package/dist/builds/worker.js.map +1 -1
- package/dist/fetch.d.ts +113 -6
- package/dist/node.d.cts +113 -6
- package/dist/node.d.ts +113 -6
- package/dist/src/searchClient.cjs +10 -10
- package/dist/src/searchClient.cjs.map +1 -1
- package/dist/src/searchClient.js +10 -10
- package/dist/src/searchClient.js.map +1 -1
- package/dist/worker.d.ts +113 -6
- package/package.json +6 -6
package/dist/src/searchClient.js
CHANGED
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
getAlgoliaAgent,
|
|
8
8
|
shuffle
|
|
9
9
|
} from "@algolia/client-common";
|
|
10
|
-
var apiClientVersion = "5.
|
|
10
|
+
var apiClientVersion = "5.51.0";
|
|
11
11
|
function getDefaultHosts(appId) {
|
|
12
12
|
return [
|
|
13
13
|
{
|
|
@@ -117,14 +117,14 @@ function createSearchClient({
|
|
|
117
117
|
* @param waitForTaskOptions - The `waitForTaskOptions` object.
|
|
118
118
|
* @param waitForTaskOptions.indexName - The `indexName` where the operation was performed.
|
|
119
119
|
* @param waitForTaskOptions.taskID - The `taskID` returned in the method response.
|
|
120
|
-
* @param waitForTaskOptions.maxRetries - The maximum number of retries.
|
|
120
|
+
* @param waitForTaskOptions.maxRetries - The maximum number of retries. 100 by default.
|
|
121
121
|
* @param waitForTaskOptions.timeout - The function to decide how long to wait between retries.
|
|
122
122
|
* @param requestOptions - The requestOptions to send along with the query, they will be forwarded to the `getTask` method and merged with the transporter requestOptions.
|
|
123
123
|
*/
|
|
124
124
|
waitForTask({
|
|
125
125
|
indexName,
|
|
126
126
|
taskID,
|
|
127
|
-
maxRetries =
|
|
127
|
+
maxRetries = 100,
|
|
128
128
|
timeout = (retryCount) => Math.min(retryCount * 200, 5e3)
|
|
129
129
|
}, requestOptions) {
|
|
130
130
|
let retryCount = 0;
|
|
@@ -134,7 +134,7 @@ function createSearchClient({
|
|
|
134
134
|
aggregator: () => retryCount += 1,
|
|
135
135
|
error: {
|
|
136
136
|
validate: () => retryCount >= maxRetries,
|
|
137
|
-
message: () => `
|
|
137
|
+
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.`
|
|
138
138
|
},
|
|
139
139
|
timeout: () => timeout(retryCount)
|
|
140
140
|
});
|
|
@@ -145,13 +145,13 @@ function createSearchClient({
|
|
|
145
145
|
* @summary Helper method that waits for a task to be published (completed).
|
|
146
146
|
* @param waitForAppTaskOptions - The `waitForTaskOptions` object.
|
|
147
147
|
* @param waitForAppTaskOptions.taskID - The `taskID` returned in the method response.
|
|
148
|
-
* @param waitForAppTaskOptions.maxRetries - The maximum number of retries.
|
|
148
|
+
* @param waitForAppTaskOptions.maxRetries - The maximum number of retries. 100 by default.
|
|
149
149
|
* @param waitForAppTaskOptions.timeout - The function to decide how long to wait between retries.
|
|
150
150
|
* @param requestOptions - The requestOptions to send along with the query, they will be forwarded to the `getTask` method and merged with the transporter requestOptions.
|
|
151
151
|
*/
|
|
152
152
|
waitForAppTask({
|
|
153
153
|
taskID,
|
|
154
|
-
maxRetries =
|
|
154
|
+
maxRetries = 100,
|
|
155
155
|
timeout = (retryCount) => Math.min(retryCount * 200, 5e3)
|
|
156
156
|
}, requestOptions) {
|
|
157
157
|
let retryCount = 0;
|
|
@@ -161,7 +161,7 @@ function createSearchClient({
|
|
|
161
161
|
aggregator: () => retryCount += 1,
|
|
162
162
|
error: {
|
|
163
163
|
validate: () => retryCount >= maxRetries,
|
|
164
|
-
message: () => `
|
|
164
|
+
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.`
|
|
165
165
|
},
|
|
166
166
|
timeout: () => timeout(retryCount)
|
|
167
167
|
});
|
|
@@ -174,7 +174,7 @@ function createSearchClient({
|
|
|
174
174
|
* @param waitForApiKeyOptions.operation - The `operation` that was done on a `key`.
|
|
175
175
|
* @param waitForApiKeyOptions.key - The `key` that has been added, deleted or updated.
|
|
176
176
|
* @param waitForApiKeyOptions.apiKey - Necessary to know if an `update` operation has been processed, compare fields of the response with it.
|
|
177
|
-
* @param waitForApiKeyOptions.maxRetries - The maximum number of retries.
|
|
177
|
+
* @param waitForApiKeyOptions.maxRetries - The maximum number of retries. 100 by default.
|
|
178
178
|
* @param waitForApiKeyOptions.timeout - The function to decide how long to wait between retries.
|
|
179
179
|
* @param requestOptions - The requestOptions to send along with the query, they will be forwarded to the `getApikey` method and merged with the transporter requestOptions.
|
|
180
180
|
*/
|
|
@@ -182,7 +182,7 @@ function createSearchClient({
|
|
|
182
182
|
operation,
|
|
183
183
|
key,
|
|
184
184
|
apiKey,
|
|
185
|
-
maxRetries =
|
|
185
|
+
maxRetries = 100,
|
|
186
186
|
timeout = (retryCount) => Math.min(retryCount * 200, 5e3)
|
|
187
187
|
}, requestOptions) {
|
|
188
188
|
let retryCount = 0;
|
|
@@ -190,7 +190,7 @@ function createSearchClient({
|
|
|
190
190
|
aggregator: () => retryCount += 1,
|
|
191
191
|
error: {
|
|
192
192
|
validate: () => retryCount >= maxRetries,
|
|
193
|
-
message: () => `
|
|
193
|
+
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.`
|
|
194
194
|
},
|
|
195
195
|
timeout: () => timeout(retryCount)
|
|
196
196
|
};
|