@algolia/ingestion 1.52.1 → 1.53.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 +5 -4
- package/dist/builds/browser.js +6 -4
- 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 +3 -3
- package/dist/builds/fetch.js +6 -4
- package/dist/builds/fetch.js.map +1 -1
- package/dist/builds/node.cjs +6 -4
- package/dist/builds/node.cjs.map +1 -1
- package/dist/builds/node.js +6 -4
- package/dist/builds/node.js.map +1 -1
- package/dist/builds/worker.js +6 -4
- package/dist/builds/worker.js.map +1 -1
- package/dist/fetch.d.ts +5 -4
- package/dist/node.d.cts +5 -4
- package/dist/node.d.ts +5 -4
- package/dist/src/ingestionClient.cjs +6 -4
- package/dist/src/ingestionClient.cjs.map +1 -1
- package/dist/src/ingestionClient.js +6 -11
- package/dist/src/ingestionClient.js.map +1 -1
- package/dist/worker.d.ts +5 -4
- package/package.json +9 -9
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/ingestion@1.
|
|
43
|
+
yarn add @algolia/ingestion@1.53.0
|
|
44
44
|
# or
|
|
45
|
-
npm install @algolia/ingestion@1.
|
|
45
|
+
npm install @algolia/ingestion@1.53.0
|
|
46
46
|
# or
|
|
47
|
-
pnpm add @algolia/ingestion@1.
|
|
47
|
+
pnpm add @algolia/ingestion@1.53.0
|
|
48
48
|
```
|
|
49
49
|
|
|
50
50
|
### Without a package manager
|
|
@@ -52,7 +52,7 @@ pnpm add @algolia/ingestion@1.52.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/ingestion@1.
|
|
55
|
+
<script src="https://cdn.jsdelivr.net/npm/@algolia/ingestion@1.53.0/dist/builds/browser.umd.js"></script>
|
|
56
56
|
```
|
|
57
57
|
|
|
58
58
|
### Usage
|
package/dist/browser.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as _algolia_client_common from '@algolia/client-common';
|
|
2
|
-
import { CreateClientOptions, RequestOptions, ClientOptions } from '@algolia/client-common';
|
|
2
|
+
import { ChunkedHelperOptions, CreateClientOptions, RequestOptions, ClientOptions } from '@algolia/client-common';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Credentials for authenticating with an API key.
|
|
@@ -2513,7 +2513,7 @@ type ValidateSourceBeforeUpdateProps = {
|
|
|
2513
2513
|
sourceID: string;
|
|
2514
2514
|
sourceUpdate: SourceUpdate;
|
|
2515
2515
|
};
|
|
2516
|
-
type ChunkedPushOptions = {
|
|
2516
|
+
type ChunkedPushOptions = ChunkedHelperOptions & {
|
|
2517
2517
|
/**
|
|
2518
2518
|
* The `indexName` to replace `objects` in.
|
|
2519
2519
|
*/
|
|
@@ -2540,7 +2540,7 @@ type ChunkedPushOptions = {
|
|
|
2540
2540
|
objects: Array<Record<string, unknown>>;
|
|
2541
2541
|
};
|
|
2542
2542
|
|
|
2543
|
-
declare const apiClientVersion = "1.
|
|
2543
|
+
declare const apiClientVersion = "1.53.0";
|
|
2544
2544
|
declare const REGIONS: readonly ["eu", "us"];
|
|
2545
2545
|
type Region = (typeof REGIONS)[number];
|
|
2546
2546
|
type RegionOptions = {
|
|
@@ -2612,9 +2612,10 @@ declare function createIngestionClient({ appId: appIdOption, apiKey: apiKeyOptio
|
|
|
2612
2612
|
* @param chunkedPush.waitForTasks - Whether or not we should wait until every `batch` tasks has been processed, this operation may slow the total execution time of this method but is more reliable.
|
|
2613
2613
|
* @param chunkedPush.batchSize - The size of the chunk of `objects`. The number of `batch` calls will be equal to `length(objects) / batchSize`. Defaults to 1000.
|
|
2614
2614
|
* @param chunkedPush.referenceIndexName - This is required when targeting an index that does not have a push connector setup (e.g. a tmp index), but you wish to attach another index's transformation to it (e.g. the source index name).
|
|
2615
|
+
* @param chunkedPush.maxRetries - The maximum number of retries when polling for task completion. 100 by default.
|
|
2615
2616
|
* @param requestOptions - The requestOptions to send along with the query, they will be forwarded to the `getEvent` method and merged with the transporter requestOptions.
|
|
2616
2617
|
*/
|
|
2617
|
-
chunkedPush({ indexName, objects, action, waitForTasks, batchSize, referenceIndexName, }: ChunkedPushOptions, requestOptions?: RequestOptions): Promise<Array<WatchResponse>>;
|
|
2618
|
+
chunkedPush({ indexName, objects, action, waitForTasks, batchSize, referenceIndexName, maxRetries, }: ChunkedPushOptions, requestOptions?: RequestOptions): Promise<Array<WatchResponse>>;
|
|
2618
2619
|
/**
|
|
2619
2620
|
* Creates a new authentication resource.
|
|
2620
2621
|
*
|
package/dist/builds/browser.js
CHANGED
|
@@ -9,7 +9,7 @@ import { createXhrRequester } from "@algolia/requester-browser-xhr";
|
|
|
9
9
|
|
|
10
10
|
// src/ingestionClient.ts
|
|
11
11
|
import { createAuth, createIterablePromise, createTransporter, getAlgoliaAgent } from "@algolia/client-common";
|
|
12
|
-
var apiClientVersion = "1.
|
|
12
|
+
var apiClientVersion = "1.53.0";
|
|
13
13
|
var REGIONS = ["eu", "us"];
|
|
14
14
|
function getDefaultHosts(region) {
|
|
15
15
|
const url = "data.{region}.algolia.com".replace("{region}", region);
|
|
@@ -106,6 +106,7 @@ function createIngestionClient({
|
|
|
106
106
|
* @param chunkedPush.waitForTasks - Whether or not we should wait until every `batch` tasks has been processed, this operation may slow the total execution time of this method but is more reliable.
|
|
107
107
|
* @param chunkedPush.batchSize - The size of the chunk of `objects`. The number of `batch` calls will be equal to `length(objects) / batchSize`. Defaults to 1000.
|
|
108
108
|
* @param chunkedPush.referenceIndexName - This is required when targeting an index that does not have a push connector setup (e.g. a tmp index), but you wish to attach another index's transformation to it (e.g. the source index name).
|
|
109
|
+
* @param chunkedPush.maxRetries - The maximum number of retries when polling for task completion. 100 by default.
|
|
109
110
|
* @param requestOptions - The requestOptions to send along with the query, they will be forwarded to the `getEvent` method and merged with the transporter requestOptions.
|
|
110
111
|
*/
|
|
111
112
|
async chunkedPush({
|
|
@@ -114,7 +115,8 @@ function createIngestionClient({
|
|
|
114
115
|
action = "addObject",
|
|
115
116
|
waitForTasks,
|
|
116
117
|
batchSize = 1e3,
|
|
117
|
-
referenceIndexName
|
|
118
|
+
referenceIndexName,
|
|
119
|
+
maxRetries = 100
|
|
118
120
|
}, requestOptions) {
|
|
119
121
|
let records = [];
|
|
120
122
|
let offset = 0;
|
|
@@ -150,8 +152,8 @@ function createIngestionClient({
|
|
|
150
152
|
validate: (response) => response !== void 0,
|
|
151
153
|
aggregator: () => retryCount += 1,
|
|
152
154
|
error: {
|
|
153
|
-
validate: () => retryCount >=
|
|
154
|
-
message: () => `
|
|
155
|
+
validate: () => retryCount >= maxRetries,
|
|
156
|
+
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.`
|
|
155
157
|
},
|
|
156
158
|
timeout: () => Math.min(retryCount * 1500, 5e3)
|
|
157
159
|
});
|