@algolia/client-search 5.54.1 → 5.55.1

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 CHANGED
@@ -40,11 +40,11 @@ All of our clients comes with type definition, and are available for both browse
40
40
  ### With a package manager
41
41
 
42
42
  ```bash
43
- yarn add @algolia/client-search@5.54.1
43
+ yarn add @algolia/client-search@5.55.1
44
44
  # or
45
- npm install @algolia/client-search@5.54.1
45
+ npm install @algolia/client-search@5.55.1
46
46
  # or
47
- pnpm add @algolia/client-search@5.54.1
47
+ pnpm add @algolia/client-search@5.55.1
48
48
  ```
49
49
 
50
50
  ### Without a package manager
@@ -52,7 +52,7 @@ pnpm add @algolia/client-search@5.54.1
52
52
  Add the following JavaScript snippet to the <head> of your website:
53
53
 
54
54
  ```html
55
- <script src="https://cdn.jsdelivr.net/npm/@algolia/client-search@5.54.1/dist/builds/browser.umd.js"></script>
55
+ <script src="https://cdn.jsdelivr.net/npm/@algolia/client-search@5.55.1/dist/builds/browser.umd.js"></script>
56
56
  ```
57
57
 
58
58
  ### Usage
package/dist/browser.d.ts CHANGED
@@ -847,7 +847,7 @@ type GetObjectsResponse<T = Record<string, unknown>> = {
847
847
  /**
848
848
  * Retrieved records.
849
849
  */
850
- results: T[];
850
+ results: (T | null)[];
851
851
  };
852
852
 
853
853
  /**
@@ -3242,7 +3242,7 @@ type AccountCopyIndexOptions = ChunkedHelperOptions & {
3242
3242
  batchSize?: number | undefined;
3243
3243
  };
3244
3244
 
3245
- declare const apiClientVersion = "5.54.1";
3245
+ declare const apiClientVersion = "5.55.1";
3246
3246
  declare function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode, algoliaAgents, ...options }: CreateClientOptions): {
3247
3247
  transporter: _algolia_client_common.Transporter;
3248
3248
  /**
@@ -3413,10 +3413,10 @@ declare function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption,
3413
3413
  * @param replaceAllObjects.objects - The array of `objects` to store in the given Algolia `indexName`.
3414
3414
  * @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.
3415
3415
  * @param replaceAllObjects.scopes - The `scopes` to keep from the index. Defaults to ['settings', 'rules', 'synonyms'].
3416
- * @param replaceAllObjects.maxRetries - The maximum number of retries when polling for task completion. 100 by default.
3416
+ * @param replaceAllObjects.maxRetries - The maximum number of retries when polling for task completion. 800 by default.
3417
3417
  * @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.
3418
3418
  */
3419
- replaceAllObjects({ indexName, objects, batchSize, scopes, maxRetries }: ReplaceAllObjectsOptions, requestOptions?: RequestOptions | undefined): Promise<ReplaceAllObjectsResponse>;
3419
+ replaceAllObjects({ indexName, objects, batchSize, scopes, maxRetries, }: ReplaceAllObjectsOptions, requestOptions?: RequestOptions | undefined): Promise<ReplaceAllObjectsResponse>;
3420
3420
  indexExists({ indexName }: GetSettingsProps): Promise<boolean>;
3421
3421
  /**
3422
3422
  * Helper: calls the `search` method but with certainty that we will only request Algolia records (hits) and not facets.
@@ -10,6 +10,7 @@ import { createXhrRequester } from "@algolia/requester-browser-xhr";
10
10
  // src/searchClient.ts
11
11
  import {
12
12
  ApiError,
13
+ DEFAULT_REPLACE_ALL_OBJECTS_MAX_RETRIES,
13
14
  createAuth,
14
15
  createIterablePromise,
15
16
  createTransporter,
@@ -17,7 +18,7 @@ import {
17
18
  shuffle,
18
19
  validateRequired
19
20
  } from "@algolia/client-common";
20
- var apiClientVersion = "5.54.1";
21
+ var apiClientVersion = "5.55.1";
21
22
  function getDefaultHosts(appId) {
22
23
  return [
23
24
  {
@@ -458,10 +459,16 @@ function createSearchClient({
458
459
  * @param replaceAllObjects.objects - The array of `objects` to store in the given Algolia `indexName`.
459
460
  * @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.
460
461
  * @param replaceAllObjects.scopes - The `scopes` to keep from the index. Defaults to ['settings', 'rules', 'synonyms'].
461
- * @param replaceAllObjects.maxRetries - The maximum number of retries when polling for task completion. 100 by default.
462
+ * @param replaceAllObjects.maxRetries - The maximum number of retries when polling for task completion. 800 by default.
462
463
  * @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.
463
464
  */
464
- async replaceAllObjects({ indexName, objects, batchSize, scopes, maxRetries = 100 }, requestOptions) {
465
+ async replaceAllObjects({
466
+ indexName,
467
+ objects,
468
+ batchSize,
469
+ scopes,
470
+ maxRetries = DEFAULT_REPLACE_ALL_OBJECTS_MAX_RETRIES
471
+ }, requestOptions) {
465
472
  const randomSuffix = Math.floor(Math.random() * 1e6) + 1e5;
466
473
  const tmpIndexName = `${indexName}_tmp_${randomSuffix}`;
467
474
  if (scopes === void 0) {