@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.
@@ -1,6 +1,6 @@
1
1
  // src/ingestionClient.ts
2
2
  import { createAuth, createTransporter, getAlgoliaAgent } from "@algolia/client-common";
3
- var apiClientVersion = "1.26.0";
3
+ var apiClientVersion = "1.28.0";
4
4
  var REGIONS = ["eu", "us"];
5
5
  function getDefaultHosts(region) {
6
6
  const url = "data.{region}.algolia.com".replace("{region}", region);
@@ -265,12 +265,6 @@ function createIngestionClient({
265
265
  if (!transformationCreate.name) {
266
266
  throw new Error("Parameter `transformationCreate.name` is required when calling `createTransformation`.");
267
267
  }
268
- if (!transformationCreate.type) {
269
- throw new Error("Parameter `transformationCreate.type` is required when calling `createTransformation`.");
270
- }
271
- if (!transformationCreate.input) {
272
- throw new Error("Parameter `transformationCreate.input` is required when calling `createTransformation`.");
273
- }
274
268
  const requestPath = "/1/transformations";
275
269
  const headers = {};
276
270
  const queryParameters = {};
@@ -1303,9 +1297,10 @@ function createIngestionClient({
1303
1297
  * @param push.indexName - Name of the index on which to perform the operation.
1304
1298
  * @param push.pushTaskPayload - The pushTaskPayload object.
1305
1299
  * @param push.watch - When provided, the push operation will be synchronous and the API will wait for the ingestion to be finished before responding.
1300
+ * @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).
1306
1301
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1307
1302
  */
1308
- push({ indexName, pushTaskPayload, watch }, requestOptions) {
1303
+ push({ indexName, pushTaskPayload, watch, referenceIndexName }, requestOptions) {
1309
1304
  if (!indexName) {
1310
1305
  throw new Error("Parameter `indexName` is required when calling `push`.");
1311
1306
  }
@@ -1324,6 +1319,9 @@ function createIngestionClient({
1324
1319
  if (watch !== void 0) {
1325
1320
  queryParameters["watch"] = watch.toString();
1326
1321
  }
1322
+ if (referenceIndexName !== void 0) {
1323
+ queryParameters["referenceIndexName"] = referenceIndexName.toString();
1324
+ }
1327
1325
  const request = {
1328
1326
  method: "POST",
1329
1327
  path: requestPath,
@@ -1336,7 +1334,7 @@ function createIngestionClient({
1336
1334
  connect: 18e4,
1337
1335
  read: 18e4,
1338
1336
  write: 18e4,
1339
- ...requestOptions?.timeouts
1337
+ ...requestOptions == null ? void 0 : requestOptions.timeouts
1340
1338
  }
1341
1339
  };
1342
1340
  return transporter.request(request, requestOptions);
@@ -1385,7 +1383,7 @@ function createIngestionClient({
1385
1383
  connect: 18e4,
1386
1384
  read: 18e4,
1387
1385
  write: 18e4,
1388
- ...requestOptions?.timeouts
1386
+ ...requestOptions == null ? void 0 : requestOptions.timeouts
1389
1387
  }
1390
1388
  };
1391
1389
  return transporter.request(request, requestOptions);
@@ -1681,7 +1679,7 @@ function createIngestionClient({
1681
1679
  connect: 18e4,
1682
1680
  read: 18e4,
1683
1681
  write: 18e4,
1684
- ...requestOptions?.timeouts
1682
+ ...requestOptions == null ? void 0 : requestOptions.timeouts
1685
1683
  }
1686
1684
  };
1687
1685
  return transporter.request(request, requestOptions);
@@ -1700,9 +1698,6 @@ function createIngestionClient({
1700
1698
  if (!transformationTry) {
1701
1699
  throw new Error("Parameter `transformationTry` is required when calling `tryTransformation`.");
1702
1700
  }
1703
- if (!transformationTry.code) {
1704
- throw new Error("Parameter `transformationTry.code` is required when calling `tryTransformation`.");
1705
- }
1706
1701
  if (!transformationTry.sampleRecord) {
1707
1702
  throw new Error("Parameter `transformationTry.sampleRecord` is required when calling `tryTransformation`.");
1708
1703
  }
@@ -1737,9 +1732,6 @@ function createIngestionClient({
1737
1732
  if (!transformationTry) {
1738
1733
  throw new Error("Parameter `transformationTry` is required when calling `tryTransformationBeforeUpdate`.");
1739
1734
  }
1740
- if (!transformationTry.code) {
1741
- throw new Error("Parameter `transformationTry.code` is required when calling `tryTransformationBeforeUpdate`.");
1742
- }
1743
1735
  if (!transformationTry.sampleRecord) {
1744
1736
  throw new Error(
1745
1737
  "Parameter `transformationTry.sampleRecord` is required when calling `tryTransformationBeforeUpdate`."
@@ -1930,12 +1922,6 @@ function createIngestionClient({
1930
1922
  if (!transformationCreate.name) {
1931
1923
  throw new Error("Parameter `transformationCreate.name` is required when calling `updateTransformation`.");
1932
1924
  }
1933
- if (!transformationCreate.type) {
1934
- throw new Error("Parameter `transformationCreate.type` is required when calling `updateTransformation`.");
1935
- }
1936
- if (!transformationCreate.input) {
1937
- throw new Error("Parameter `transformationCreate.input` is required when calling `updateTransformation`.");
1938
- }
1939
1925
  const requestPath = "/1/transformations/{transformationID}".replace(
1940
1926
  "{transformationID}",
1941
1927
  encodeURIComponent(transformationID)
@@ -1977,7 +1963,7 @@ function createIngestionClient({
1977
1963
  connect: 18e4,
1978
1964
  read: 18e4,
1979
1965
  write: 18e4,
1980
- ...requestOptions?.timeouts
1966
+ ...requestOptions == null ? void 0 : requestOptions.timeouts
1981
1967
  }
1982
1968
  };
1983
1969
  return transporter.request(request, requestOptions);
@@ -2016,7 +2002,7 @@ function createIngestionClient({
2016
2002
  connect: 18e4,
2017
2003
  read: 18e4,
2018
2004
  write: 18e4,
2019
- ...requestOptions?.timeouts
2005
+ ...requestOptions == null ? void 0 : requestOptions.timeouts
2020
2006
  }
2021
2007
  };
2022
2008
  return transporter.request(request, requestOptions);