@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.
package/dist/fetch.d.ts CHANGED
@@ -678,7 +678,7 @@ type SourceShopify = SourceUpdateShopify & SourceShopifyBase;
678
678
 
679
679
  type SourceInput = SourceCommercetools | SourceBigCommerce | SourceJSON | SourceCSV | SourceBigQuery | SourceGA4BigQueryExport | SourceDocker | SourceShopify;
680
680
 
681
- type SourceType = 'bigcommerce' | 'bigquery' | 'commercetools' | 'csv' | 'docker' | 'ga4BigqueryExport' | 'json' | 'shopify' | 'sfcc' | 'push';
681
+ type SourceType = 'bigcommerce' | 'bigquery' | 'commercetools' | 'csv' | 'docker' | 'ga4BigqueryExport' | 'json' | 'shopify' | 'push';
682
682
 
683
683
  type Source = {
684
684
  /**
@@ -2046,6 +2046,10 @@ type ListTasksProps = {
2046
2046
  * Source IDs for filtering the list of tasks.
2047
2047
  */
2048
2048
  sourceID?: Array<string>;
2049
+ /**
2050
+ * Filters the tasks with the specified source type.
2051
+ */
2052
+ sourceType?: Array<SourceType>;
2049
2053
  /**
2050
2054
  * Destination IDs for filtering the list of tasks.
2051
2055
  */
@@ -2137,6 +2141,10 @@ type PushTaskProps = {
2137
2141
  * Request body of a Search API `batch` request that will be pushed in the Connectors pipeline.
2138
2142
  */
2139
2143
  pushTaskPayload: PushTaskPayload;
2144
+ /**
2145
+ * When provided, the push operation will be synchronous and the API will wait for the ingestion to be finished before responding.
2146
+ */
2147
+ watch?: boolean;
2140
2148
  };
2141
2149
  /**
2142
2150
  * Properties for the `runSource` method.
@@ -2259,7 +2267,7 @@ type ValidateSourceBeforeUpdateProps = {
2259
2267
  sourceUpdate: SourceUpdate;
2260
2268
  };
2261
2269
 
2262
- declare const apiClientVersion = "1.15.0";
2270
+ declare const apiClientVersion = "1.17.0";
2263
2271
  declare const REGIONS: readonly ["eu", "us"];
2264
2272
  type Region = (typeof REGIONS)[number];
2265
2273
  type RegionOptions = {
@@ -2708,13 +2716,14 @@ declare function createIngestionClient({ appId: appIdOption, apiKey: apiKeyOptio
2708
2716
  * @param listTasks.action - Actions for filtering the list of tasks.
2709
2717
  * @param listTasks.enabled - Whether to filter the list of tasks by the `enabled` status.
2710
2718
  * @param listTasks.sourceID - Source IDs for filtering the list of tasks.
2719
+ * @param listTasks.sourceType - Filters the tasks with the specified source type.
2711
2720
  * @param listTasks.destinationID - Destination IDs for filtering the list of tasks.
2712
2721
  * @param listTasks.triggerType - Type of task trigger for filtering the list of tasks.
2713
2722
  * @param listTasks.sort - Property by which to sort the list of tasks.
2714
2723
  * @param listTasks.order - Sort order of the response, ascending or descending.
2715
2724
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
2716
2725
  */
2717
- listTasks({ itemsPerPage, page, action, enabled, sourceID, destinationID, triggerType, sort, order }?: ListTasksProps, requestOptions?: RequestOptions | undefined): Promise<ListTasksResponse>;
2726
+ listTasks({ itemsPerPage, page, action, enabled, sourceID, sourceType, destinationID, triggerType, sort, order, }?: ListTasksProps, requestOptions?: RequestOptions | undefined): Promise<ListTasksResponse>;
2718
2727
  /**
2719
2728
  * Retrieves a list of tasks using the v1 endpoint, please use `getTasks` instead.
2720
2729
  *
@@ -2760,9 +2769,10 @@ declare function createIngestionClient({ appId: appIdOption, apiKey: apiKeyOptio
2760
2769
  * @param pushTask - The pushTask object.
2761
2770
  * @param pushTask.taskID - Unique identifier of a task.
2762
2771
  * @param pushTask.pushTaskPayload - Request body of a Search API `batch` request that will be pushed in the Connectors pipeline.
2772
+ * @param pushTask.watch - When provided, the push operation will be synchronous and the API will wait for the ingestion to be finished before responding.
2763
2773
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
2764
2774
  */
2765
- pushTask({ taskID, pushTaskPayload }: PushTaskProps, requestOptions?: RequestOptions): Promise<RunResponse>;
2775
+ pushTask({ taskID, pushTaskPayload, watch }: PushTaskProps, requestOptions?: RequestOptions): Promise<RunResponse>;
2766
2776
  /**
2767
2777
  * Runs all tasks linked to a source, only available for Shopify sources. It will create 1 run per task.
2768
2778
  *
package/dist/node.d.cts CHANGED
@@ -678,7 +678,7 @@ type SourceShopify = SourceUpdateShopify & SourceShopifyBase;
678
678
 
679
679
  type SourceInput = SourceCommercetools | SourceBigCommerce | SourceJSON | SourceCSV | SourceBigQuery | SourceGA4BigQueryExport | SourceDocker | SourceShopify;
680
680
 
681
- type SourceType = 'bigcommerce' | 'bigquery' | 'commercetools' | 'csv' | 'docker' | 'ga4BigqueryExport' | 'json' | 'shopify' | 'sfcc' | 'push';
681
+ type SourceType = 'bigcommerce' | 'bigquery' | 'commercetools' | 'csv' | 'docker' | 'ga4BigqueryExport' | 'json' | 'shopify' | 'push';
682
682
 
683
683
  type Source = {
684
684
  /**
@@ -2046,6 +2046,10 @@ type ListTasksProps = {
2046
2046
  * Source IDs for filtering the list of tasks.
2047
2047
  */
2048
2048
  sourceID?: Array<string>;
2049
+ /**
2050
+ * Filters the tasks with the specified source type.
2051
+ */
2052
+ sourceType?: Array<SourceType>;
2049
2053
  /**
2050
2054
  * Destination IDs for filtering the list of tasks.
2051
2055
  */
@@ -2137,6 +2141,10 @@ type PushTaskProps = {
2137
2141
  * Request body of a Search API `batch` request that will be pushed in the Connectors pipeline.
2138
2142
  */
2139
2143
  pushTaskPayload: PushTaskPayload;
2144
+ /**
2145
+ * When provided, the push operation will be synchronous and the API will wait for the ingestion to be finished before responding.
2146
+ */
2147
+ watch?: boolean;
2140
2148
  };
2141
2149
  /**
2142
2150
  * Properties for the `runSource` method.
@@ -2259,7 +2267,7 @@ type ValidateSourceBeforeUpdateProps = {
2259
2267
  sourceUpdate: SourceUpdate;
2260
2268
  };
2261
2269
 
2262
- declare const apiClientVersion = "1.15.0";
2270
+ declare const apiClientVersion = "1.17.0";
2263
2271
  declare const REGIONS: readonly ["eu", "us"];
2264
2272
  type Region = (typeof REGIONS)[number];
2265
2273
  type RegionOptions = {
@@ -2708,13 +2716,14 @@ declare function createIngestionClient({ appId: appIdOption, apiKey: apiKeyOptio
2708
2716
  * @param listTasks.action - Actions for filtering the list of tasks.
2709
2717
  * @param listTasks.enabled - Whether to filter the list of tasks by the `enabled` status.
2710
2718
  * @param listTasks.sourceID - Source IDs for filtering the list of tasks.
2719
+ * @param listTasks.sourceType - Filters the tasks with the specified source type.
2711
2720
  * @param listTasks.destinationID - Destination IDs for filtering the list of tasks.
2712
2721
  * @param listTasks.triggerType - Type of task trigger for filtering the list of tasks.
2713
2722
  * @param listTasks.sort - Property by which to sort the list of tasks.
2714
2723
  * @param listTasks.order - Sort order of the response, ascending or descending.
2715
2724
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
2716
2725
  */
2717
- listTasks({ itemsPerPage, page, action, enabled, sourceID, destinationID, triggerType, sort, order }?: ListTasksProps, requestOptions?: RequestOptions | undefined): Promise<ListTasksResponse>;
2726
+ listTasks({ itemsPerPage, page, action, enabled, sourceID, sourceType, destinationID, triggerType, sort, order, }?: ListTasksProps, requestOptions?: RequestOptions | undefined): Promise<ListTasksResponse>;
2718
2727
  /**
2719
2728
  * Retrieves a list of tasks using the v1 endpoint, please use `getTasks` instead.
2720
2729
  *
@@ -2760,9 +2769,10 @@ declare function createIngestionClient({ appId: appIdOption, apiKey: apiKeyOptio
2760
2769
  * @param pushTask - The pushTask object.
2761
2770
  * @param pushTask.taskID - Unique identifier of a task.
2762
2771
  * @param pushTask.pushTaskPayload - Request body of a Search API `batch` request that will be pushed in the Connectors pipeline.
2772
+ * @param pushTask.watch - When provided, the push operation will be synchronous and the API will wait for the ingestion to be finished before responding.
2763
2773
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
2764
2774
  */
2765
- pushTask({ taskID, pushTaskPayload }: PushTaskProps, requestOptions?: RequestOptions): Promise<RunResponse>;
2775
+ pushTask({ taskID, pushTaskPayload, watch }: PushTaskProps, requestOptions?: RequestOptions): Promise<RunResponse>;
2766
2776
  /**
2767
2777
  * Runs all tasks linked to a source, only available for Shopify sources. It will create 1 run per task.
2768
2778
  *
package/dist/node.d.ts CHANGED
@@ -678,7 +678,7 @@ type SourceShopify = SourceUpdateShopify & SourceShopifyBase;
678
678
 
679
679
  type SourceInput = SourceCommercetools | SourceBigCommerce | SourceJSON | SourceCSV | SourceBigQuery | SourceGA4BigQueryExport | SourceDocker | SourceShopify;
680
680
 
681
- type SourceType = 'bigcommerce' | 'bigquery' | 'commercetools' | 'csv' | 'docker' | 'ga4BigqueryExport' | 'json' | 'shopify' | 'sfcc' | 'push';
681
+ type SourceType = 'bigcommerce' | 'bigquery' | 'commercetools' | 'csv' | 'docker' | 'ga4BigqueryExport' | 'json' | 'shopify' | 'push';
682
682
 
683
683
  type Source = {
684
684
  /**
@@ -2046,6 +2046,10 @@ type ListTasksProps = {
2046
2046
  * Source IDs for filtering the list of tasks.
2047
2047
  */
2048
2048
  sourceID?: Array<string>;
2049
+ /**
2050
+ * Filters the tasks with the specified source type.
2051
+ */
2052
+ sourceType?: Array<SourceType>;
2049
2053
  /**
2050
2054
  * Destination IDs for filtering the list of tasks.
2051
2055
  */
@@ -2137,6 +2141,10 @@ type PushTaskProps = {
2137
2141
  * Request body of a Search API `batch` request that will be pushed in the Connectors pipeline.
2138
2142
  */
2139
2143
  pushTaskPayload: PushTaskPayload;
2144
+ /**
2145
+ * When provided, the push operation will be synchronous and the API will wait for the ingestion to be finished before responding.
2146
+ */
2147
+ watch?: boolean;
2140
2148
  };
2141
2149
  /**
2142
2150
  * Properties for the `runSource` method.
@@ -2259,7 +2267,7 @@ type ValidateSourceBeforeUpdateProps = {
2259
2267
  sourceUpdate: SourceUpdate;
2260
2268
  };
2261
2269
 
2262
- declare const apiClientVersion = "1.15.0";
2270
+ declare const apiClientVersion = "1.17.0";
2263
2271
  declare const REGIONS: readonly ["eu", "us"];
2264
2272
  type Region = (typeof REGIONS)[number];
2265
2273
  type RegionOptions = {
@@ -2708,13 +2716,14 @@ declare function createIngestionClient({ appId: appIdOption, apiKey: apiKeyOptio
2708
2716
  * @param listTasks.action - Actions for filtering the list of tasks.
2709
2717
  * @param listTasks.enabled - Whether to filter the list of tasks by the `enabled` status.
2710
2718
  * @param listTasks.sourceID - Source IDs for filtering the list of tasks.
2719
+ * @param listTasks.sourceType - Filters the tasks with the specified source type.
2711
2720
  * @param listTasks.destinationID - Destination IDs for filtering the list of tasks.
2712
2721
  * @param listTasks.triggerType - Type of task trigger for filtering the list of tasks.
2713
2722
  * @param listTasks.sort - Property by which to sort the list of tasks.
2714
2723
  * @param listTasks.order - Sort order of the response, ascending or descending.
2715
2724
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
2716
2725
  */
2717
- listTasks({ itemsPerPage, page, action, enabled, sourceID, destinationID, triggerType, sort, order }?: ListTasksProps, requestOptions?: RequestOptions | undefined): Promise<ListTasksResponse>;
2726
+ listTasks({ itemsPerPage, page, action, enabled, sourceID, sourceType, destinationID, triggerType, sort, order, }?: ListTasksProps, requestOptions?: RequestOptions | undefined): Promise<ListTasksResponse>;
2718
2727
  /**
2719
2728
  * Retrieves a list of tasks using the v1 endpoint, please use `getTasks` instead.
2720
2729
  *
@@ -2760,9 +2769,10 @@ declare function createIngestionClient({ appId: appIdOption, apiKey: apiKeyOptio
2760
2769
  * @param pushTask - The pushTask object.
2761
2770
  * @param pushTask.taskID - Unique identifier of a task.
2762
2771
  * @param pushTask.pushTaskPayload - Request body of a Search API `batch` request that will be pushed in the Connectors pipeline.
2772
+ * @param pushTask.watch - When provided, the push operation will be synchronous and the API will wait for the ingestion to be finished before responding.
2763
2773
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
2764
2774
  */
2765
- pushTask({ taskID, pushTaskPayload }: PushTaskProps, requestOptions?: RequestOptions): Promise<RunResponse>;
2775
+ pushTask({ taskID, pushTaskPayload, watch }: PushTaskProps, requestOptions?: RequestOptions): Promise<RunResponse>;
2766
2776
  /**
2767
2777
  * Runs all tasks linked to a source, only available for Shopify sources. It will create 1 run per task.
2768
2778
  *
@@ -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.15.0";
32
+ var apiClientVersion = "1.17.0";
33
33
  var REGIONS = ["eu", "us"];
34
34
  function getDefaultHosts(region) {
35
35
  const url = "data.{region}.algolia.com".replace("{region}", region);
@@ -1141,13 +1141,25 @@ function createIngestionClient({
1141
1141
  * @param listTasks.action - Actions for filtering the list of tasks.
1142
1142
  * @param listTasks.enabled - Whether to filter the list of tasks by the `enabled` status.
1143
1143
  * @param listTasks.sourceID - Source IDs for filtering the list of tasks.
1144
+ * @param listTasks.sourceType - Filters the tasks with the specified source type.
1144
1145
  * @param listTasks.destinationID - Destination IDs for filtering the list of tasks.
1145
1146
  * @param listTasks.triggerType - Type of task trigger for filtering the list of tasks.
1146
1147
  * @param listTasks.sort - Property by which to sort the list of tasks.
1147
1148
  * @param listTasks.order - Sort order of the response, ascending or descending.
1148
1149
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1149
1150
  */
1150
- listTasks({ itemsPerPage, page, action, enabled, sourceID, destinationID, triggerType, sort, order } = {}, requestOptions = void 0) {
1151
+ listTasks({
1152
+ itemsPerPage,
1153
+ page,
1154
+ action,
1155
+ enabled,
1156
+ sourceID,
1157
+ sourceType,
1158
+ destinationID,
1159
+ triggerType,
1160
+ sort,
1161
+ order
1162
+ } = {}, requestOptions = void 0) {
1151
1163
  const requestPath = "/2/tasks";
1152
1164
  const headers = {};
1153
1165
  const queryParameters = {};
@@ -1166,6 +1178,9 @@ function createIngestionClient({
1166
1178
  if (sourceID !== void 0) {
1167
1179
  queryParameters["sourceID"] = sourceID.toString();
1168
1180
  }
1181
+ if (sourceType !== void 0) {
1182
+ queryParameters["sourceType"] = sourceType.toString();
1183
+ }
1169
1184
  if (destinationID !== void 0) {
1170
1185
  queryParameters["destinationID"] = destinationID.toString();
1171
1186
  }
@@ -1292,9 +1307,10 @@ function createIngestionClient({
1292
1307
  * @param pushTask - The pushTask object.
1293
1308
  * @param pushTask.taskID - Unique identifier of a task.
1294
1309
  * @param pushTask.pushTaskPayload - Request body of a Search API `batch` request that will be pushed in the Connectors pipeline.
1310
+ * @param pushTask.watch - When provided, the push operation will be synchronous and the API will wait for the ingestion to be finished before responding.
1295
1311
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1296
1312
  */
1297
- pushTask({ taskID, pushTaskPayload }, requestOptions) {
1313
+ pushTask({ taskID, pushTaskPayload, watch }, requestOptions) {
1298
1314
  if (!taskID) {
1299
1315
  throw new Error("Parameter `taskID` is required when calling `pushTask`.");
1300
1316
  }
@@ -1310,6 +1326,9 @@ function createIngestionClient({
1310
1326
  const requestPath = "/2/tasks/{taskID}/push".replace("{taskID}", encodeURIComponent(taskID));
1311
1327
  const headers = {};
1312
1328
  const queryParameters = {};
1329
+ if (watch !== void 0) {
1330
+ queryParameters["watch"] = watch.toString();
1331
+ }
1313
1332
  const request = {
1314
1333
  method: "POST",
1315
1334
  path: requestPath,