@algolia/client-search 5.34.1 → 5.36.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 +33 -29
- package/dist/builds/browser.js +2 -2
- 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 +1 -1
- package/dist/builds/fetch.js +13 -5
- package/dist/builds/fetch.js.map +1 -1
- package/dist/builds/node.cjs +13 -5
- package/dist/builds/node.cjs.map +1 -1
- package/dist/builds/node.js +13 -5
- package/dist/builds/node.js.map +1 -1
- package/dist/builds/worker.js +2 -2
- package/dist/builds/worker.js.map +1 -1
- package/dist/fetch.d.ts +33 -29
- package/dist/node.d.cts +33 -29
- package/dist/node.d.ts +33 -29
- package/dist/src/searchClient.cjs +2 -2
- package/dist/src/searchClient.cjs.map +1 -1
- package/dist/src/searchClient.js +5 -2
- package/dist/src/searchClient.js.map +1 -1
- package/dist/worker.d.ts +33 -29
- package/package.json +7 -7
package/dist/builds/node.cjs
CHANGED
|
@@ -30,7 +30,7 @@ var import_client_common2 = require("@algolia/client-common");
|
|
|
30
30
|
|
|
31
31
|
// src/searchClient.ts
|
|
32
32
|
var import_client_common = require("@algolia/client-common");
|
|
33
|
-
var apiClientVersion = "5.
|
|
33
|
+
var apiClientVersion = "5.36.0";
|
|
34
34
|
function getDefaultHosts(appId) {
|
|
35
35
|
return [
|
|
36
36
|
{
|
|
@@ -450,7 +450,7 @@ function createSearchClient({
|
|
|
450
450
|
},
|
|
451
451
|
/**
|
|
452
452
|
* 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.
|
|
453
|
-
* See https://api-clients-automation.netlify.app/docs/
|
|
453
|
+
* See https://api-clients-automation.netlify.app/docs/custom-helpers/#replaceallobjects for implementation details.
|
|
454
454
|
*
|
|
455
455
|
* @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.
|
|
456
456
|
* @param replaceAllObjects - The `replaceAllObjects` object.
|
|
@@ -2405,7 +2405,7 @@ function searchClient(appId, apiKey, options) {
|
|
|
2405
2405
|
},
|
|
2406
2406
|
/**
|
|
2407
2407
|
* Helper: Copies the given `sourceIndexName` records, rules and synonyms to an other Algolia application for the given `destinationIndexName`.
|
|
2408
|
-
* See https://api-clients-automation.netlify.app/docs/
|
|
2408
|
+
* See https://api-clients-automation.netlify.app/docs/custom-helpers/#replaceallobjects for implementation details.
|
|
2409
2409
|
*
|
|
2410
2410
|
* @summary Helper: Copies the given `sourceIndexName` records, rules and synonyms to an other Algolia application for the given `destinationIndexName`.
|
|
2411
2411
|
* @param accountCopyIndex - The `accountCopyIndex` object.
|
|
@@ -2413,9 +2413,16 @@ function searchClient(appId, apiKey, options) {
|
|
|
2413
2413
|
* @param accountCopyIndex.destinationAppID - The application ID to write the index to.
|
|
2414
2414
|
* @param accountCopyIndex.destinationApiKey - The API Key of the `destinationAppID` to write the index to, must have write ACLs.
|
|
2415
2415
|
* @param accountCopyIndex.destinationIndexName - The name of the index to write the copied index to.
|
|
2416
|
+
* @param accountCopyIndex.batchSize - The size of the chunk of `objects`. Defaults to 1000.
|
|
2416
2417
|
* @param requestOptions - The requestOptions to send along with the query, they will be forwarded to the `setSettings`, `saveRules`, `saveSynonyms` and `saveObjects` method and merged with the transporter requestOptions.
|
|
2417
2418
|
*/
|
|
2418
|
-
async accountCopyIndex({
|
|
2419
|
+
async accountCopyIndex({
|
|
2420
|
+
sourceIndexName,
|
|
2421
|
+
destinationAppID,
|
|
2422
|
+
destinationApiKey,
|
|
2423
|
+
destinationIndexName,
|
|
2424
|
+
batchSize
|
|
2425
|
+
}, requestOptions) {
|
|
2419
2426
|
const responses = [];
|
|
2420
2427
|
if (this.appId === destinationAppID) {
|
|
2421
2428
|
throw new import_client_common2.IndicesInSameAppError();
|
|
@@ -2475,10 +2482,11 @@ function searchClient(appId, apiKey, options) {
|
|
|
2475
2482
|
});
|
|
2476
2483
|
await this.browseObjects({
|
|
2477
2484
|
indexName: sourceIndexName,
|
|
2485
|
+
browseParams: batchSize ? { hitsPerPage: batchSize } : void 0,
|
|
2478
2486
|
async aggregator(response) {
|
|
2479
2487
|
responses.push(
|
|
2480
2488
|
...await destinationClient.saveObjects(
|
|
2481
|
-
{ indexName: destinationIndexName, objects: response.hits },
|
|
2489
|
+
{ indexName: destinationIndexName, objects: response.hits, batchSize },
|
|
2482
2490
|
requestOptions
|
|
2483
2491
|
)
|
|
2484
2492
|
);
|