@algolia/ingestion 1.15.0 → 1.17.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.15.0";
35
+ var apiClientVersion = "1.17.0";
36
36
  var REGIONS = ["eu", "us"];
37
37
  function getDefaultHosts(region) {
38
38
  const url = "data.{region}.algolia.com".replace("{region}", region);
@@ -1144,13 +1144,25 @@ function createIngestionClient({
1144
1144
  * @param listTasks.action - Actions for filtering the list of tasks.
1145
1145
  * @param listTasks.enabled - Whether to filter the list of tasks by the `enabled` status.
1146
1146
  * @param listTasks.sourceID - Source IDs for filtering the list of tasks.
1147
+ * @param listTasks.sourceType - Filters the tasks with the specified source type.
1147
1148
  * @param listTasks.destinationID - Destination IDs for filtering the list of tasks.
1148
1149
  * @param listTasks.triggerType - Type of task trigger for filtering the list of tasks.
1149
1150
  * @param listTasks.sort - Property by which to sort the list of tasks.
1150
1151
  * @param listTasks.order - Sort order of the response, ascending or descending.
1151
1152
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1152
1153
  */
1153
- listTasks({ itemsPerPage, page, action, enabled, sourceID, destinationID, triggerType, sort, order } = {}, requestOptions = void 0) {
1154
+ listTasks({
1155
+ itemsPerPage,
1156
+ page,
1157
+ action,
1158
+ enabled,
1159
+ sourceID,
1160
+ sourceType,
1161
+ destinationID,
1162
+ triggerType,
1163
+ sort,
1164
+ order
1165
+ } = {}, requestOptions = void 0) {
1154
1166
  const requestPath = "/2/tasks";
1155
1167
  const headers = {};
1156
1168
  const queryParameters = {};
@@ -1169,6 +1181,9 @@ function createIngestionClient({
1169
1181
  if (sourceID !== void 0) {
1170
1182
  queryParameters["sourceID"] = sourceID.toString();
1171
1183
  }
1184
+ if (sourceType !== void 0) {
1185
+ queryParameters["sourceType"] = sourceType.toString();
1186
+ }
1172
1187
  if (destinationID !== void 0) {
1173
1188
  queryParameters["destinationID"] = destinationID.toString();
1174
1189
  }
@@ -1295,9 +1310,10 @@ function createIngestionClient({
1295
1310
  * @param pushTask - The pushTask object.
1296
1311
  * @param pushTask.taskID - Unique identifier of a task.
1297
1312
  * @param pushTask.pushTaskPayload - Request body of a Search API `batch` request that will be pushed in the Connectors pipeline.
1313
+ * @param pushTask.watch - When provided, the push operation will be synchronous and the API will wait for the ingestion to be finished before responding.
1298
1314
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1299
1315
  */
1300
- pushTask({ taskID, pushTaskPayload }, requestOptions) {
1316
+ pushTask({ taskID, pushTaskPayload, watch }, requestOptions) {
1301
1317
  if (!taskID) {
1302
1318
  throw new Error("Parameter `taskID` is required when calling `pushTask`.");
1303
1319
  }
@@ -1313,6 +1329,9 @@ function createIngestionClient({
1313
1329
  const requestPath = "/2/tasks/{taskID}/push".replace("{taskID}", encodeURIComponent(taskID));
1314
1330
  const headers = {};
1315
1331
  const queryParameters = {};
1332
+ if (watch !== void 0) {
1333
+ queryParameters["watch"] = watch.toString();
1334
+ }
1316
1335
  const request = {
1317
1336
  method: "POST",
1318
1337
  path: requestPath,
@@ -1940,9 +1959,9 @@ function ingestionClient(appId, apiKey, region, options) {
1940
1959
  apiKey,
1941
1960
  region,
1942
1961
  timeouts: {
1943
- connect: import_client_common2.DEFAULT_CONNECT_TIMEOUT_NODE,
1944
- read: import_client_common2.DEFAULT_READ_TIMEOUT_NODE,
1945
- write: import_client_common2.DEFAULT_WRITE_TIMEOUT_NODE
1962
+ connect: 25e3,
1963
+ read: 25e3,
1964
+ write: 25e3
1946
1965
  },
1947
1966
  logger: (0, import_client_common2.createNullLogger)(),
1948
1967
  requester: (0, import_requester_node_http.createHttpRequester)(),