@algolia/ingestion 1.26.0 → 1.28.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 +236 -229
- package/dist/builds/browser.js +6 -20
- 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 +6 -20
- package/dist/builds/fetch.js.map +1 -1
- package/dist/builds/node.cjs +6 -20
- package/dist/builds/node.cjs.map +1 -1
- package/dist/builds/node.js +6 -20
- package/dist/builds/node.js.map +1 -1
- package/dist/builds/worker.js +6 -20
- package/dist/builds/worker.js.map +1 -1
- package/dist/fetch.d.ts +236 -229
- package/dist/node.d.cts +236 -229
- package/dist/node.d.ts +236 -229
- package/dist/src/ingestionClient.cjs +6 -20
- package/dist/src/ingestionClient.cjs.map +1 -1
- package/dist/src/ingestionClient.js +11 -25
- package/dist/src/ingestionClient.js.map +1 -1
- package/dist/worker.d.ts +236 -229
- package/package.json +7 -7
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.28.0";
|
|
8
8
|
var REGIONS = ["eu", "us"];
|
|
9
9
|
function getDefaultHosts(region) {
|
|
10
10
|
const url = "data.{region}.algolia.com".replace("{region}", region);
|
|
@@ -269,12 +269,6 @@ function createIngestionClient({
|
|
|
269
269
|
if (!transformationCreate.name) {
|
|
270
270
|
throw new Error("Parameter `transformationCreate.name` is required when calling `createTransformation`.");
|
|
271
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
|
-
}
|
|
278
272
|
const requestPath = "/1/transformations";
|
|
279
273
|
const headers = {};
|
|
280
274
|
const queryParameters = {};
|
|
@@ -1307,9 +1301,10 @@ function createIngestionClient({
|
|
|
1307
1301
|
* @param push.indexName - Name of the index on which to perform the operation.
|
|
1308
1302
|
* @param push.pushTaskPayload - The pushTaskPayload object.
|
|
1309
1303
|
* @param push.watch - When provided, the push operation will be synchronous and the API will wait for the ingestion to be finished before responding.
|
|
1304
|
+
* @param push.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).
|
|
1310
1305
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
1311
1306
|
*/
|
|
1312
|
-
push({ indexName, pushTaskPayload, watch }, requestOptions) {
|
|
1307
|
+
push({ indexName, pushTaskPayload, watch, referenceIndexName }, requestOptions) {
|
|
1313
1308
|
if (!indexName) {
|
|
1314
1309
|
throw new Error("Parameter `indexName` is required when calling `push`.");
|
|
1315
1310
|
}
|
|
@@ -1328,6 +1323,9 @@ function createIngestionClient({
|
|
|
1328
1323
|
if (watch !== void 0) {
|
|
1329
1324
|
queryParameters["watch"] = watch.toString();
|
|
1330
1325
|
}
|
|
1326
|
+
if (referenceIndexName !== void 0) {
|
|
1327
|
+
queryParameters["referenceIndexName"] = referenceIndexName.toString();
|
|
1328
|
+
}
|
|
1331
1329
|
const request = {
|
|
1332
1330
|
method: "POST",
|
|
1333
1331
|
path: requestPath,
|
|
@@ -1704,9 +1702,6 @@ function createIngestionClient({
|
|
|
1704
1702
|
if (!transformationTry) {
|
|
1705
1703
|
throw new Error("Parameter `transformationTry` is required when calling `tryTransformation`.");
|
|
1706
1704
|
}
|
|
1707
|
-
if (!transformationTry.code) {
|
|
1708
|
-
throw new Error("Parameter `transformationTry.code` is required when calling `tryTransformation`.");
|
|
1709
|
-
}
|
|
1710
1705
|
if (!transformationTry.sampleRecord) {
|
|
1711
1706
|
throw new Error("Parameter `transformationTry.sampleRecord` is required when calling `tryTransformation`.");
|
|
1712
1707
|
}
|
|
@@ -1741,9 +1736,6 @@ function createIngestionClient({
|
|
|
1741
1736
|
if (!transformationTry) {
|
|
1742
1737
|
throw new Error("Parameter `transformationTry` is required when calling `tryTransformationBeforeUpdate`.");
|
|
1743
1738
|
}
|
|
1744
|
-
if (!transformationTry.code) {
|
|
1745
|
-
throw new Error("Parameter `transformationTry.code` is required when calling `tryTransformationBeforeUpdate`.");
|
|
1746
|
-
}
|
|
1747
1739
|
if (!transformationTry.sampleRecord) {
|
|
1748
1740
|
throw new Error(
|
|
1749
1741
|
"Parameter `transformationTry.sampleRecord` is required when calling `tryTransformationBeforeUpdate`."
|
|
@@ -1934,12 +1926,6 @@ function createIngestionClient({
|
|
|
1934
1926
|
if (!transformationCreate.name) {
|
|
1935
1927
|
throw new Error("Parameter `transformationCreate.name` is required when calling `updateTransformation`.");
|
|
1936
1928
|
}
|
|
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
|
-
}
|
|
1943
1929
|
const requestPath = "/1/transformations/{transformationID}".replace(
|
|
1944
1930
|
"{transformationID}",
|
|
1945
1931
|
encodeURIComponent(transformationID)
|