@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.
@@ -32,7 +32,7 @@ var import_client_common2 = require("@algolia/client-common");
32
32
 
33
33
  // src/ingestionClient.ts
34
34
  var import_client_common = require("@algolia/client-common");
35
- var apiClientVersion = "1.26.0";
35
+ var apiClientVersion = "1.28.0";
36
36
  var REGIONS = ["eu", "us"];
37
37
  function getDefaultHosts(region) {
38
38
  const url = "data.{region}.algolia.com".replace("{region}", region);
@@ -297,12 +297,6 @@ function createIngestionClient({
297
297
  if (!transformationCreate.name) {
298
298
  throw new Error("Parameter `transformationCreate.name` is required when calling `createTransformation`.");
299
299
  }
300
- if (!transformationCreate.type) {
301
- throw new Error("Parameter `transformationCreate.type` is required when calling `createTransformation`.");
302
- }
303
- if (!transformationCreate.input) {
304
- throw new Error("Parameter `transformationCreate.input` is required when calling `createTransformation`.");
305
- }
306
300
  const requestPath = "/1/transformations";
307
301
  const headers = {};
308
302
  const queryParameters = {};
@@ -1335,9 +1329,10 @@ function createIngestionClient({
1335
1329
  * @param push.indexName - Name of the index on which to perform the operation.
1336
1330
  * @param push.pushTaskPayload - The pushTaskPayload object.
1337
1331
  * @param push.watch - When provided, the push operation will be synchronous and the API will wait for the ingestion to be finished before responding.
1332
+ * @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).
1338
1333
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1339
1334
  */
1340
- push({ indexName, pushTaskPayload, watch }, requestOptions) {
1335
+ push({ indexName, pushTaskPayload, watch, referenceIndexName }, requestOptions) {
1341
1336
  if (!indexName) {
1342
1337
  throw new Error("Parameter `indexName` is required when calling `push`.");
1343
1338
  }
@@ -1356,6 +1351,9 @@ function createIngestionClient({
1356
1351
  if (watch !== void 0) {
1357
1352
  queryParameters["watch"] = watch.toString();
1358
1353
  }
1354
+ if (referenceIndexName !== void 0) {
1355
+ queryParameters["referenceIndexName"] = referenceIndexName.toString();
1356
+ }
1359
1357
  const request = {
1360
1358
  method: "POST",
1361
1359
  path: requestPath,
@@ -1732,9 +1730,6 @@ function createIngestionClient({
1732
1730
  if (!transformationTry) {
1733
1731
  throw new Error("Parameter `transformationTry` is required when calling `tryTransformation`.");
1734
1732
  }
1735
- if (!transformationTry.code) {
1736
- throw new Error("Parameter `transformationTry.code` is required when calling `tryTransformation`.");
1737
- }
1738
1733
  if (!transformationTry.sampleRecord) {
1739
1734
  throw new Error("Parameter `transformationTry.sampleRecord` is required when calling `tryTransformation`.");
1740
1735
  }
@@ -1769,9 +1764,6 @@ function createIngestionClient({
1769
1764
  if (!transformationTry) {
1770
1765
  throw new Error("Parameter `transformationTry` is required when calling `tryTransformationBeforeUpdate`.");
1771
1766
  }
1772
- if (!transformationTry.code) {
1773
- throw new Error("Parameter `transformationTry.code` is required when calling `tryTransformationBeforeUpdate`.");
1774
- }
1775
1767
  if (!transformationTry.sampleRecord) {
1776
1768
  throw new Error(
1777
1769
  "Parameter `transformationTry.sampleRecord` is required when calling `tryTransformationBeforeUpdate`."
@@ -1962,12 +1954,6 @@ function createIngestionClient({
1962
1954
  if (!transformationCreate.name) {
1963
1955
  throw new Error("Parameter `transformationCreate.name` is required when calling `updateTransformation`.");
1964
1956
  }
1965
- if (!transformationCreate.type) {
1966
- throw new Error("Parameter `transformationCreate.type` is required when calling `updateTransformation`.");
1967
- }
1968
- if (!transformationCreate.input) {
1969
- throw new Error("Parameter `transformationCreate.input` is required when calling `updateTransformation`.");
1970
- }
1971
1957
  const requestPath = "/1/transformations/{transformationID}".replace(
1972
1958
  "{transformationID}",
1973
1959
  encodeURIComponent(transformationID)