@algolia/ingestion 1.36.0 → 1.37.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.36.0";
35
+ var apiClientVersion = "1.37.0";
36
36
  var REGIONS = ["eu", "us"];
37
37
  function getDefaultHosts(region) {
38
38
  const url = "data.{region}.algolia.com".replace("{region}", region);
@@ -1486,6 +1486,38 @@ function createIngestionClient({
1486
1486
  };
1487
1487
  return transporter.request(request, requestOptions);
1488
1488
  },
1489
+ /**
1490
+ * Fully updates a task by its ID, use partialUpdateTask if you only want to update a subset of fields.
1491
+ * @param replaceTask - The replaceTask object.
1492
+ * @param replaceTask.taskID - Unique identifier of a task.
1493
+ * @param replaceTask.taskReplace - The taskReplace object.
1494
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1495
+ */
1496
+ replaceTask({ taskID, taskReplace }, requestOptions) {
1497
+ if (!taskID) {
1498
+ throw new Error("Parameter `taskID` is required when calling `replaceTask`.");
1499
+ }
1500
+ if (!taskReplace) {
1501
+ throw new Error("Parameter `taskReplace` is required when calling `replaceTask`.");
1502
+ }
1503
+ if (!taskReplace.destinationID) {
1504
+ throw new Error("Parameter `taskReplace.destinationID` is required when calling `replaceTask`.");
1505
+ }
1506
+ if (!taskReplace.action) {
1507
+ throw new Error("Parameter `taskReplace.action` is required when calling `replaceTask`.");
1508
+ }
1509
+ const requestPath = "/2/tasks/{taskID}".replace("{taskID}", encodeURIComponent(taskID));
1510
+ const headers = {};
1511
+ const queryParameters = {};
1512
+ const request = {
1513
+ method: "PUT",
1514
+ path: requestPath,
1515
+ queryParameters,
1516
+ headers,
1517
+ data: taskReplace
1518
+ };
1519
+ return transporter.request(request, requestOptions);
1520
+ },
1489
1521
  /**
1490
1522
  * Runs all tasks linked to a source, only available for Shopify, BigCommerce and commercetools sources. Creates one run per task.
1491
1523
  *
@@ -1954,7 +1986,7 @@ function createIngestionClient({
1954
1986
  return transporter.request(request, requestOptions);
1955
1987
  },
1956
1988
  /**
1957
- * Updates a task by its ID.
1989
+ * Partially updates a task by its ID.
1958
1990
  * @param updateTask - The updateTask object.
1959
1991
  * @param updateTask.taskID - Unique identifier of a task.
1960
1992
  * @param updateTask.taskUpdate - The taskUpdate object.