@algolia/ingestion 1.24.0 → 1.26.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 +75 -11
- package/dist/builds/browser.js +64 -9
- 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 +64 -9
- package/dist/builds/fetch.js.map +1 -1
- package/dist/builds/node.cjs +64 -9
- package/dist/builds/node.cjs.map +1 -1
- package/dist/builds/node.js +64 -9
- package/dist/builds/node.js.map +1 -1
- package/dist/builds/worker.js +64 -9
- package/dist/builds/worker.js.map +1 -1
- package/dist/fetch.d.ts +75 -11
- package/dist/node.d.cts +75 -11
- package/dist/node.d.ts +75 -11
- package/dist/src/ingestionClient.cjs +64 -9
- package/dist/src/ingestionClient.cjs.map +1 -1
- package/dist/src/ingestionClient.js +64 -9
- package/dist/src/ingestionClient.js.map +1 -1
- package/dist/worker.d.ts +75 -11
- package/package.json +9 -9
package/dist/builds/worker.js
CHANGED
|
@@ -4,7 +4,7 @@ import { createFetchRequester } from "@algolia/requester-fetch";
|
|
|
4
4
|
|
|
5
5
|
// src/ingestionClient.ts
|
|
6
6
|
import { createAuth, createTransporter, getAlgoliaAgent } from "@algolia/client-common";
|
|
7
|
-
var apiClientVersion = "1.
|
|
7
|
+
var apiClientVersion = "1.26.0";
|
|
8
8
|
var REGIONS = ["eu", "us"];
|
|
9
9
|
function getDefaultHosts(region) {
|
|
10
10
|
const url = "data.{region}.algolia.com".replace("{region}", region);
|
|
@@ -266,12 +266,15 @@ function createIngestionClient({
|
|
|
266
266
|
if (!transformationCreate) {
|
|
267
267
|
throw new Error("Parameter `transformationCreate` is required when calling `createTransformation`.");
|
|
268
268
|
}
|
|
269
|
-
if (!transformationCreate.code) {
|
|
270
|
-
throw new Error("Parameter `transformationCreate.code` is required when calling `createTransformation`.");
|
|
271
|
-
}
|
|
272
269
|
if (!transformationCreate.name) {
|
|
273
270
|
throw new Error("Parameter `transformationCreate.name` is required when calling `createTransformation`.");
|
|
274
271
|
}
|
|
272
|
+
if (!transformationCreate.type) {
|
|
273
|
+
throw new Error("Parameter `transformationCreate.type` is required when calling `createTransformation`.");
|
|
274
|
+
}
|
|
275
|
+
if (!transformationCreate.input) {
|
|
276
|
+
throw new Error("Parameter `transformationCreate.input` is required when calling `createTransformation`.");
|
|
277
|
+
}
|
|
275
278
|
const requestPath = "/1/transformations";
|
|
276
279
|
const headers = {};
|
|
277
280
|
const queryParameters = {};
|
|
@@ -1294,7 +1297,56 @@ function createIngestionClient({
|
|
|
1294
1297
|
return transporter.request(request, requestOptions);
|
|
1295
1298
|
},
|
|
1296
1299
|
/**
|
|
1297
|
-
*
|
|
1300
|
+
* Pushes records through the Pipeline, directly to an index. You can make the call synchronous by providing the `watch` parameter, for asynchronous calls, you can use the observability endpoints and/or debugger dashboard to see the status of your task. If you want to leverage the [pre-indexing data transformation](https://www.algolia.com/doc/guides/sending-and-managing-data/send-and-update-your-data/how-to/transform-your-data/), this is the recommended way of ingesting your records. This method is similar to `pushTask`, but requires an `indexName` instead of a `taskID`. If zero or many tasks are found, an error will be returned.
|
|
1301
|
+
*
|
|
1302
|
+
* Required API Key ACLs:
|
|
1303
|
+
* - addObject
|
|
1304
|
+
* - deleteIndex
|
|
1305
|
+
* - editSettings
|
|
1306
|
+
* @param push - The push object.
|
|
1307
|
+
* @param push.indexName - Name of the index on which to perform the operation.
|
|
1308
|
+
* @param push.pushTaskPayload - The pushTaskPayload object.
|
|
1309
|
+
* @param push.watch - When provided, the push operation will be synchronous and the API will wait for the ingestion to be finished before responding.
|
|
1310
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
1311
|
+
*/
|
|
1312
|
+
push({ indexName, pushTaskPayload, watch }, requestOptions) {
|
|
1313
|
+
if (!indexName) {
|
|
1314
|
+
throw new Error("Parameter `indexName` is required when calling `push`.");
|
|
1315
|
+
}
|
|
1316
|
+
if (!pushTaskPayload) {
|
|
1317
|
+
throw new Error("Parameter `pushTaskPayload` is required when calling `push`.");
|
|
1318
|
+
}
|
|
1319
|
+
if (!pushTaskPayload.action) {
|
|
1320
|
+
throw new Error("Parameter `pushTaskPayload.action` is required when calling `push`.");
|
|
1321
|
+
}
|
|
1322
|
+
if (!pushTaskPayload.records) {
|
|
1323
|
+
throw new Error("Parameter `pushTaskPayload.records` is required when calling `push`.");
|
|
1324
|
+
}
|
|
1325
|
+
const requestPath = "/1/push/{indexName}".replace("{indexName}", encodeURIComponent(indexName));
|
|
1326
|
+
const headers = {};
|
|
1327
|
+
const queryParameters = {};
|
|
1328
|
+
if (watch !== void 0) {
|
|
1329
|
+
queryParameters["watch"] = watch.toString();
|
|
1330
|
+
}
|
|
1331
|
+
const request = {
|
|
1332
|
+
method: "POST",
|
|
1333
|
+
path: requestPath,
|
|
1334
|
+
queryParameters,
|
|
1335
|
+
headers,
|
|
1336
|
+
data: pushTaskPayload
|
|
1337
|
+
};
|
|
1338
|
+
requestOptions = {
|
|
1339
|
+
timeouts: {
|
|
1340
|
+
connect: 18e4,
|
|
1341
|
+
read: 18e4,
|
|
1342
|
+
write: 18e4,
|
|
1343
|
+
...requestOptions == null ? void 0 : requestOptions.timeouts
|
|
1344
|
+
}
|
|
1345
|
+
};
|
|
1346
|
+
return transporter.request(request, requestOptions);
|
|
1347
|
+
},
|
|
1348
|
+
/**
|
|
1349
|
+
* Pushes records through the Pipeline, directly to an index. You can make the call synchronous by providing the `watch` parameter, for asynchronous calls, you can use the observability endpoints and/or debugger dashboard to see the status of your task. If you want to leverage the [pre-indexing data transformation](https://www.algolia.com/doc/guides/sending-and-managing-data/send-and-update-your-data/how-to/transform-your-data/), this is the recommended way of ingesting your records. This method is similar to `push`, but requires a `taskID` instead of a `indexName`, which is useful when many `destinations` target the same `indexName`.
|
|
1298
1350
|
*
|
|
1299
1351
|
* Required API Key ACLs:
|
|
1300
1352
|
* - addObject
|
|
@@ -1302,7 +1354,7 @@ function createIngestionClient({
|
|
|
1302
1354
|
* - editSettings
|
|
1303
1355
|
* @param pushTask - The pushTask object.
|
|
1304
1356
|
* @param pushTask.taskID - Unique identifier of a task.
|
|
1305
|
-
* @param pushTask.pushTaskPayload -
|
|
1357
|
+
* @param pushTask.pushTaskPayload - The pushTaskPayload object.
|
|
1306
1358
|
* @param pushTask.watch - When provided, the push operation will be synchronous and the API will wait for the ingestion to be finished before responding.
|
|
1307
1359
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
1308
1360
|
*/
|
|
@@ -1879,12 +1931,15 @@ function createIngestionClient({
|
|
|
1879
1931
|
if (!transformationCreate) {
|
|
1880
1932
|
throw new Error("Parameter `transformationCreate` is required when calling `updateTransformation`.");
|
|
1881
1933
|
}
|
|
1882
|
-
if (!transformationCreate.code) {
|
|
1883
|
-
throw new Error("Parameter `transformationCreate.code` is required when calling `updateTransformation`.");
|
|
1884
|
-
}
|
|
1885
1934
|
if (!transformationCreate.name) {
|
|
1886
1935
|
throw new Error("Parameter `transformationCreate.name` is required when calling `updateTransformation`.");
|
|
1887
1936
|
}
|
|
1937
|
+
if (!transformationCreate.type) {
|
|
1938
|
+
throw new Error("Parameter `transformationCreate.type` is required when calling `updateTransformation`.");
|
|
1939
|
+
}
|
|
1940
|
+
if (!transformationCreate.input) {
|
|
1941
|
+
throw new Error("Parameter `transformationCreate.input` is required when calling `updateTransformation`.");
|
|
1942
|
+
}
|
|
1888
1943
|
const requestPath = "/1/transformations/{transformationID}".replace(
|
|
1889
1944
|
"{transformationID}",
|
|
1890
1945
|
encodeURIComponent(transformationID)
|