@algolia/client-search 5.55.0 → 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 +4 -4
- package/dist/browser.d.ts +4 -4
- package/dist/builds/browser.js +10 -3
- package/dist/builds/browser.js.map +1 -1
- package/dist/builds/browser.min.js +4 -4
- package/dist/builds/browser.min.js.map +1 -1
- package/dist/builds/browser.umd.js +5 -5
- package/dist/builds/fetch.js +10 -3
- package/dist/builds/fetch.js.map +1 -1
- package/dist/builds/node.cjs +9 -3
- package/dist/builds/node.cjs.map +1 -1
- package/dist/builds/node.js +10 -3
- package/dist/builds/node.js.map +1 -1
- package/dist/builds/worker.js +10 -3
- package/dist/builds/worker.js.map +1 -1
- package/dist/fetch.d.ts +4 -4
- package/dist/node.d.cts +4 -4
- package/dist/node.d.ts +4 -4
- package/dist/src/searchClient.cjs +9 -3
- package/dist/src/searchClient.cjs.map +1 -1
- package/dist/src/searchClient.js +10 -3
- package/dist/src/searchClient.js.map +1 -1
- package/dist/worker.d.ts +4 -4
- package/package.json +6 -6
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.55.
|
|
43
|
+
yarn add @algolia/client-search@5.55.1
|
|
44
44
|
# or
|
|
45
|
-
npm install @algolia/client-search@5.55.
|
|
45
|
+
npm install @algolia/client-search@5.55.1
|
|
46
46
|
# or
|
|
47
|
-
pnpm add @algolia/client-search@5.55.
|
|
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.55.0
|
|
|
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.55.
|
|
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.55.
|
|
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.
|
|
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.
|
package/dist/builds/browser.js
CHANGED
|
@@ -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.55.
|
|
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.
|
|
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({
|
|
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) {
|