@algolia/client-search 5.50.2 → 5.52.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 +115 -8
- package/dist/builds/browser.js +12 -12
- 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 +12 -12
- package/dist/builds/fetch.js.map +1 -1
- package/dist/builds/node.cjs +12 -12
- package/dist/builds/node.cjs.map +1 -1
- package/dist/builds/node.js +12 -12
- package/dist/builds/node.js.map +1 -1
- package/dist/builds/worker.js +12 -12
- package/dist/builds/worker.js.map +1 -1
- package/dist/fetch.d.ts +115 -8
- package/dist/node.d.cts +115 -8
- package/dist/node.d.ts +115 -8
- package/dist/src/searchClient.cjs +12 -12
- package/dist/src/searchClient.cjs.map +1 -1
- package/dist/src/searchClient.js +12 -12
- package/dist/src/searchClient.js.map +1 -1
- package/dist/worker.d.ts +115 -8
- package/package.json +6 -6
package/dist/builds/node.cjs
CHANGED
|
@@ -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.
|
|
34
|
+
var apiClientVersion = "5.52.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.
|
|
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 =
|
|
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: () => `
|
|
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.
|
|
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 =
|
|
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: () => `
|
|
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.
|
|
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 =
|
|
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: () => `
|
|
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
|
};
|
|
@@ -2026,11 +2026,11 @@ function createSearchClient({
|
|
|
2026
2026
|
return transporter.request(request, requestOptions);
|
|
2027
2027
|
},
|
|
2028
2028
|
/**
|
|
2029
|
-
*
|
|
2029
|
+
* Runs multiple search queries against one or more indices in a single API request. Use cases include: - Searching different indices, such as products and marketing content. - Run multiple queries on the same index with different parameters or filters. If you know the expected result type, use the `searchForHits` or `searchForFacets` helper to simplify the response format.
|
|
2030
2030
|
*
|
|
2031
2031
|
* Required API Key ACLs:
|
|
2032
2032
|
* - search
|
|
2033
|
-
* @param searchMethodParams -
|
|
2033
|
+
* @param searchMethodParams - Multi-query search request body. Results are returned in the same order as the requests.
|
|
2034
2034
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
2035
2035
|
*/
|
|
2036
2036
|
search(searchMethodParams, requestOptions) {
|