@algolia/ingestion 1.27.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.
@@ -29,7 +29,7 @@ __export(ingestionClient_exports, {
29
29
  });
30
30
  module.exports = __toCommonJS(ingestionClient_exports);
31
31
  var import_client_common = require("@algolia/client-common");
32
- var apiClientVersion = "1.27.0";
32
+ var apiClientVersion = "1.28.0";
33
33
  var REGIONS = ["eu", "us"];
34
34
  function getDefaultHosts(region) {
35
35
  const url = "data.{region}.algolia.com".replace("{region}", region);
@@ -294,12 +294,6 @@ function createIngestionClient({
294
294
  if (!transformationCreate.name) {
295
295
  throw new Error("Parameter `transformationCreate.name` is required when calling `createTransformation`.");
296
296
  }
297
- if (!transformationCreate.type) {
298
- throw new Error("Parameter `transformationCreate.type` is required when calling `createTransformation`.");
299
- }
300
- if (!transformationCreate.input) {
301
- throw new Error("Parameter `transformationCreate.input` is required when calling `createTransformation`.");
302
- }
303
297
  const requestPath = "/1/transformations";
304
298
  const headers = {};
305
299
  const queryParameters = {};
@@ -1332,9 +1326,10 @@ function createIngestionClient({
1332
1326
  * @param push.indexName - Name of the index on which to perform the operation.
1333
1327
  * @param push.pushTaskPayload - The pushTaskPayload object.
1334
1328
  * @param push.watch - When provided, the push operation will be synchronous and the API will wait for the ingestion to be finished before responding.
1329
+ * @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).
1335
1330
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1336
1331
  */
1337
- push({ indexName, pushTaskPayload, watch }, requestOptions) {
1332
+ push({ indexName, pushTaskPayload, watch, referenceIndexName }, requestOptions) {
1338
1333
  if (!indexName) {
1339
1334
  throw new Error("Parameter `indexName` is required when calling `push`.");
1340
1335
  }
@@ -1353,6 +1348,9 @@ function createIngestionClient({
1353
1348
  if (watch !== void 0) {
1354
1349
  queryParameters["watch"] = watch.toString();
1355
1350
  }
1351
+ if (referenceIndexName !== void 0) {
1352
+ queryParameters["referenceIndexName"] = referenceIndexName.toString();
1353
+ }
1356
1354
  const request = {
1357
1355
  method: "POST",
1358
1356
  path: requestPath,
@@ -1729,9 +1727,6 @@ function createIngestionClient({
1729
1727
  if (!transformationTry) {
1730
1728
  throw new Error("Parameter `transformationTry` is required when calling `tryTransformation`.");
1731
1729
  }
1732
- if (!transformationTry.code) {
1733
- throw new Error("Parameter `transformationTry.code` is required when calling `tryTransformation`.");
1734
- }
1735
1730
  if (!transformationTry.sampleRecord) {
1736
1731
  throw new Error("Parameter `transformationTry.sampleRecord` is required when calling `tryTransformation`.");
1737
1732
  }
@@ -1766,9 +1761,6 @@ function createIngestionClient({
1766
1761
  if (!transformationTry) {
1767
1762
  throw new Error("Parameter `transformationTry` is required when calling `tryTransformationBeforeUpdate`.");
1768
1763
  }
1769
- if (!transformationTry.code) {
1770
- throw new Error("Parameter `transformationTry.code` is required when calling `tryTransformationBeforeUpdate`.");
1771
- }
1772
1764
  if (!transformationTry.sampleRecord) {
1773
1765
  throw new Error(
1774
1766
  "Parameter `transformationTry.sampleRecord` is required when calling `tryTransformationBeforeUpdate`."
@@ -1959,12 +1951,6 @@ function createIngestionClient({
1959
1951
  if (!transformationCreate.name) {
1960
1952
  throw new Error("Parameter `transformationCreate.name` is required when calling `updateTransformation`.");
1961
1953
  }
1962
- if (!transformationCreate.type) {
1963
- throw new Error("Parameter `transformationCreate.type` is required when calling `updateTransformation`.");
1964
- }
1965
- if (!transformationCreate.input) {
1966
- throw new Error("Parameter `transformationCreate.input` is required when calling `updateTransformation`.");
1967
- }
1968
1954
  const requestPath = "/1/transformations/{transformationID}".replace(
1969
1955
  "{transformationID}",
1970
1956
  encodeURIComponent(transformationID)