@algolia/ingestion 1.28.0 → 1.30.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
@@ -1477,6 +1477,11 @@ type WatchResponse = {
1477
1477
  createdAt?: string | undefined;
1478
1478
  };
1479
1479
 
1480
+ /**
1481
+ * Type of indexing operation.
1482
+ */
1483
+ type Action = 'addObject' | 'updateObject' | 'partialUpdateObject' | 'partialUpdateObjectNoCreate' | 'deleteObject' | 'delete' | 'clear';
1484
+
1480
1485
  /**
1481
1486
  * Property by which to sort the list of authentications.
1482
1487
  */
@@ -1534,11 +1539,6 @@ type PlatformNone = 'none';
1534
1539
 
1535
1540
  type PlatformWithNone = Platform | PlatformNone;
1536
1541
 
1537
- /**
1538
- * Type of indexing operation.
1539
- */
1540
- type Action = 'addObject' | 'updateObject' | 'partialUpdateObject' | 'partialUpdateObjectNoCreate' | 'deleteObject' | 'delete' | 'clear';
1541
-
1542
1542
  type PushTaskRecords = Record<string, any> & {
1543
1543
  /**
1544
1544
  * Unique record identifier.
@@ -1697,7 +1697,7 @@ type TriggerType = 'onDemand' | 'schedule' | 'subscription' | 'streaming';
1697
1697
  */
1698
1698
  type CustomDeleteProps = {
1699
1699
  /**
1700
- * Path of the endpoint, anything after \"/1\" must be specified.
1700
+ * Path of the endpoint, for example `1/newFeature`.
1701
1701
  */
1702
1702
  path: string;
1703
1703
  /**
@@ -1712,7 +1712,7 @@ type CustomDeleteProps = {
1712
1712
  */
1713
1713
  type CustomGetProps = {
1714
1714
  /**
1715
- * Path of the endpoint, anything after \"/1\" must be specified.
1715
+ * Path of the endpoint, for example `1/newFeature`.
1716
1716
  */
1717
1717
  path: string;
1718
1718
  /**
@@ -1727,7 +1727,7 @@ type CustomGetProps = {
1727
1727
  */
1728
1728
  type CustomPostProps = {
1729
1729
  /**
1730
- * Path of the endpoint, anything after \"/1\" must be specified.
1730
+ * Path of the endpoint, for example `1/newFeature`.
1731
1731
  */
1732
1732
  path: string;
1733
1733
  /**
@@ -1746,7 +1746,7 @@ type CustomPostProps = {
1746
1746
  */
1747
1747
  type CustomPutProps = {
1748
1748
  /**
1749
- * Path of the endpoint, anything after \"/1\" must be specified.
1749
+ * Path of the endpoint, for example `1/newFeature`.
1750
1750
  */
1751
1751
  path: string;
1752
1752
  /**
@@ -2362,8 +2362,34 @@ type ValidateSourceBeforeUpdateProps = {
2362
2362
  sourceID: string;
2363
2363
  sourceUpdate: SourceUpdate;
2364
2364
  };
2365
+ type ChunkedPushOptions = {
2366
+ /**
2367
+ * The `indexName` to replace `objects` in.
2368
+ */
2369
+ indexName: string;
2370
+ /**
2371
+ * The `batch` `action` to perform on the given array of `objects`, defaults to `addObject`.
2372
+ */
2373
+ action?: Action | undefined;
2374
+ /**
2375
+ * Whether or not we should wait until every `batch` tasks has been processed, this operation may slow the total execution time of this method but is more reliable.
2376
+ */
2377
+ waitForTasks?: boolean | undefined;
2378
+ /**
2379
+ * The size of the chunk of `objects`. The number of `batch` calls will be equal to `length(objects) / batchSize`. Defaults to 1000.
2380
+ */
2381
+ batchSize?: number | undefined;
2382
+ /**
2383
+ * 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).
2384
+ */
2385
+ referenceIndexName?: string | undefined;
2386
+ /**
2387
+ * The array of `objects` to store in the given Algolia `indexName`.
2388
+ */
2389
+ objects: Array<Record<string, unknown>>;
2390
+ };
2365
2391
 
2366
- declare const apiClientVersion = "1.28.0";
2392
+ declare const apiClientVersion = "1.30.0";
2367
2393
  declare const REGIONS: readonly ["eu", "us"];
2368
2394
  type Region = (typeof REGIONS)[number];
2369
2395
  type RegionOptions = {
@@ -2424,6 +2450,20 @@ declare function createIngestionClient({ appId: appIdOption, apiKey: apiKeyOptio
2424
2450
  setClientApiKey({ apiKey }: {
2425
2451
  apiKey: string;
2426
2452
  }): void;
2453
+ /**
2454
+ * Helper: Chunks the given `objects` list in subset of 1000 elements max in order to make it fit in `push` requests by leveraging the Transformation pipeline setup in the Push connector (https://www.algolia.com/doc/guides/sending-and-managing-data/send-and-update-your-data/connectors/push/).
2455
+ *
2456
+ * @summary Helper: Chunks the given `objects` list in subset of 1000 elements max in order to make it fit in `batch` requests.
2457
+ * @param chunkedPush - The `chunkedPush` object.
2458
+ * @param chunkedPush.indexName - The `indexName` to replace `objects` in.
2459
+ * @param chunkedPush.objects - The array of `objects` to store in the given Algolia `indexName`.
2460
+ * @param chunkedPush.action - The `batch` `action` to perform on the given array of `objects`, defaults to `addObject`.
2461
+ * @param chunkedPush.waitForTasks - Whether or not we should wait until every `batch` tasks has been processed, this operation may slow the total execution time of this method but is more reliable.
2462
+ * @param chunkedPush.batchSize - The size of the chunk of `objects`. The number of `batch` calls will be equal to `length(objects) / batchSize`. Defaults to 1000.
2463
+ * @param chunkedPush.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).
2464
+ * @param requestOptions - The requestOptions to send along with the query, they will be forwarded to the `getEvent` method and merged with the transporter requestOptions.
2465
+ */
2466
+ chunkedPush({ indexName, objects, action, waitForTasks, batchSize, referenceIndexName, }: ChunkedPushOptions, requestOptions?: RequestOptions): Promise<Array<WatchResponse>>;
2427
2467
  /**
2428
2468
  * Creates a new authentication resource.
2429
2469
  *
@@ -2480,7 +2520,7 @@ declare function createIngestionClient({ appId: appIdOption, apiKey: apiKeyOptio
2480
2520
  /**
2481
2521
  * This method lets you send requests to the Algolia REST API.
2482
2522
  * @param customDelete - The customDelete object.
2483
- * @param customDelete.path - Path of the endpoint, anything after \"/1\" must be specified.
2523
+ * @param customDelete.path - Path of the endpoint, for example `1/newFeature`.
2484
2524
  * @param customDelete.parameters - Query parameters to apply to the current query.
2485
2525
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
2486
2526
  */
@@ -2488,7 +2528,7 @@ declare function createIngestionClient({ appId: appIdOption, apiKey: apiKeyOptio
2488
2528
  /**
2489
2529
  * This method lets you send requests to the Algolia REST API.
2490
2530
  * @param customGet - The customGet object.
2491
- * @param customGet.path - Path of the endpoint, anything after \"/1\" must be specified.
2531
+ * @param customGet.path - Path of the endpoint, for example `1/newFeature`.
2492
2532
  * @param customGet.parameters - Query parameters to apply to the current query.
2493
2533
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
2494
2534
  */
@@ -2496,7 +2536,7 @@ declare function createIngestionClient({ appId: appIdOption, apiKey: apiKeyOptio
2496
2536
  /**
2497
2537
  * This method lets you send requests to the Algolia REST API.
2498
2538
  * @param customPost - The customPost object.
2499
- * @param customPost.path - Path of the endpoint, anything after \"/1\" must be specified.
2539
+ * @param customPost.path - Path of the endpoint, for example `1/newFeature`.
2500
2540
  * @param customPost.parameters - Query parameters to apply to the current query.
2501
2541
  * @param customPost.body - Parameters to send with the custom request.
2502
2542
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
@@ -2505,7 +2545,7 @@ declare function createIngestionClient({ appId: appIdOption, apiKey: apiKeyOptio
2505
2545
  /**
2506
2546
  * This method lets you send requests to the Algolia REST API.
2507
2547
  * @param customPut - The customPut object.
2508
- * @param customPut.path - Path of the endpoint, anything after \"/1\" must be specified.
2548
+ * @param customPut.path - Path of the endpoint, for example `1/newFeature`.
2509
2549
  * @param customPut.parameters - Query parameters to apply to the current query.
2510
2550
  * @param customPut.body - Parameters to send with the custom request.
2511
2551
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
@@ -3146,4 +3186,4 @@ type IngestionClient = ReturnType<typeof createIngestionClient>;
3146
3186
 
3147
3187
  declare function ingestionClient(appId: string, apiKey: string, region: Region, options?: ClientOptions | undefined): IngestionClient;
3148
3188
 
3149
- export { type Action, type ActionType, type AuthAPIKey, type AuthAPIKeyPartial, type AuthAlgolia, type AuthAlgoliaInsights, type AuthAlgoliaInsightsPartial, type AuthAlgoliaPartial, type AuthBasic, type AuthBasicPartial, type AuthGoogleServiceAccount, type AuthGoogleServiceAccountPartial, type AuthInput, type AuthInputPartial, type AuthOAuth, type AuthOAuthPartial, type Authentication, type AuthenticationCreate, type AuthenticationCreateResponse, type AuthenticationSearch, type AuthenticationSortKeys, type AuthenticationType, type AuthenticationUpdate, type AuthenticationUpdateResponse, type BigCommerceChannel, type BigCommerceMetafield, type BigQueryDataType, type CommercetoolsCustomFields, type CustomDeleteProps, type CustomGetProps, type CustomPostProps, type CustomPutProps, type DeleteAuthenticationProps, type DeleteDestinationProps, type DeleteResponse, type DeleteSourceProps, type DeleteTaskProps, type DeleteTaskV1Props, type DeleteTransformationProps, type Destination, type DestinationCreate, type DestinationCreateResponse, type DestinationInput, type DestinationSearch, type DestinationSortKeys, type DestinationType, type DestinationUpdate, type DestinationUpdateResponse, type DisableTaskProps, type DisableTaskV1Props, type DockerStreams, type DockerStreamsInput, type DockerStreamsSyncMode, type EmailNotifications, type EnableTaskProps, type EnableTaskV1Props, type EntityType, type ErrorBase, type Event, type EventSortKeys, type EventStatus, type EventType, type GetAuthenticationProps, type GetDestinationProps, type GetEventProps, type GetRunProps, type GetSourceProps, type GetTaskProps, type GetTaskV1Props, type GetTransformationProps, type IngestionClient, type ListAuthenticationsProps, type ListAuthenticationsResponse, type ListDestinationsProps, type ListDestinationsResponse, type ListEventsProps, type ListEventsResponse, type ListRunsProps, type ListSourcesProps, type ListSourcesResponse, type ListTasksProps, type ListTasksResponse, type ListTasksResponseV1, type ListTasksV1Props, type ListTransformationsProps, type ListTransformationsResponse, type MappingFieldDirective, type MappingFormatSchema, type MappingInput, type MappingKitAction, type MappingTypeCSV, type MethodType, type Notifications, type OnDemandTrigger, type OnDemandTriggerInput, type OnDemandTriggerType, type OrderKeys, type Pagination, type Platform, type PlatformNone, type PlatformWithNone, type Policies, type PushProps, type PushTaskPayload, type PushTaskProps, type PushTaskRecords, type RecordType, type Region, type RegionOptions, type Run, type RunListResponse, type RunOutcome, type RunProgress, type RunReasonCode, type RunResponse, type RunSortKeys, type RunSourcePayload, type RunSourceProps, type RunSourceResponse, type RunStatus, type RunTaskProps, type RunTaskV1Props, type RunType, type ScheduleTrigger, type ScheduleTriggerInput, type ScheduleTriggerType, type ShopifyInput, type ShopifyMarket, type ShopifyMetafield, type Source, type SourceBigCommerce, type SourceBigQuery, type SourceCSV, type SourceCommercetools, type SourceCreate, type SourceCreateResponse, type SourceDocker, type SourceGA4BigQueryExport, type SourceInput, type SourceJSON, type SourceSearch, type SourceShopify, type SourceShopifyBase, type SourceSortKeys, type SourceType, type SourceUpdate, type SourceUpdateCommercetools, type SourceUpdateDocker, type SourceUpdateInput, type SourceUpdateResponse, type SourceUpdateShopify, type StreamingInput, type StreamingTrigger, type StreamingTriggerType, type SubscriptionTrigger, type SubscriptionTriggerType, type Task, type TaskCreate, type TaskCreateResponse, type TaskCreateTrigger, type TaskCreateV1, type TaskInput, type TaskSearch, type TaskSortKeys, type TaskUpdate, type TaskUpdateResponse, type TaskUpdateV1, type TaskV1, type Transformation, type TransformationCode, type TransformationCreate, type TransformationCreateResponse, type TransformationError, type TransformationInput, type TransformationNoCode, type TransformationSearch, type TransformationSortKeys, type TransformationTry, type TransformationTryResponse, type TransformationType, type TransformationUpdateResponse, type Trigger, type TriggerDockerSourceDiscoverProps, type TriggerType, type TriggerUpdateInput, type TryTransformationBeforeUpdateProps, type UpdateAuthenticationProps, type UpdateDestinationProps, type UpdateSourceProps, type UpdateTaskProps, type UpdateTaskV1Props, type UpdateTransformationProps, type ValidateSourceBeforeUpdateProps, type WatchResponse, type Window, apiClientVersion, ingestionClient, isOnDemandTrigger, isScheduleTrigger, isSubscriptionTrigger };
3189
+ export { type Action, type ActionType, type AuthAPIKey, type AuthAPIKeyPartial, type AuthAlgolia, type AuthAlgoliaInsights, type AuthAlgoliaInsightsPartial, type AuthAlgoliaPartial, type AuthBasic, type AuthBasicPartial, type AuthGoogleServiceAccount, type AuthGoogleServiceAccountPartial, type AuthInput, type AuthInputPartial, type AuthOAuth, type AuthOAuthPartial, type Authentication, type AuthenticationCreate, type AuthenticationCreateResponse, type AuthenticationSearch, type AuthenticationSortKeys, type AuthenticationType, type AuthenticationUpdate, type AuthenticationUpdateResponse, type BigCommerceChannel, type BigCommerceMetafield, type BigQueryDataType, type ChunkedPushOptions, type CommercetoolsCustomFields, type CustomDeleteProps, type CustomGetProps, type CustomPostProps, type CustomPutProps, type DeleteAuthenticationProps, type DeleteDestinationProps, type DeleteResponse, type DeleteSourceProps, type DeleteTaskProps, type DeleteTaskV1Props, type DeleteTransformationProps, type Destination, type DestinationCreate, type DestinationCreateResponse, type DestinationInput, type DestinationSearch, type DestinationSortKeys, type DestinationType, type DestinationUpdate, type DestinationUpdateResponse, type DisableTaskProps, type DisableTaskV1Props, type DockerStreams, type DockerStreamsInput, type DockerStreamsSyncMode, type EmailNotifications, type EnableTaskProps, type EnableTaskV1Props, type EntityType, type ErrorBase, type Event, type EventSortKeys, type EventStatus, type EventType, type GetAuthenticationProps, type GetDestinationProps, type GetEventProps, type GetRunProps, type GetSourceProps, type GetTaskProps, type GetTaskV1Props, type GetTransformationProps, type IngestionClient, type ListAuthenticationsProps, type ListAuthenticationsResponse, type ListDestinationsProps, type ListDestinationsResponse, type ListEventsProps, type ListEventsResponse, type ListRunsProps, type ListSourcesProps, type ListSourcesResponse, type ListTasksProps, type ListTasksResponse, type ListTasksResponseV1, type ListTasksV1Props, type ListTransformationsProps, type ListTransformationsResponse, type MappingFieldDirective, type MappingFormatSchema, type MappingInput, type MappingKitAction, type MappingTypeCSV, type MethodType, type Notifications, type OnDemandTrigger, type OnDemandTriggerInput, type OnDemandTriggerType, type OrderKeys, type Pagination, type Platform, type PlatformNone, type PlatformWithNone, type Policies, type PushProps, type PushTaskPayload, type PushTaskProps, type PushTaskRecords, type RecordType, type Region, type RegionOptions, type Run, type RunListResponse, type RunOutcome, type RunProgress, type RunReasonCode, type RunResponse, type RunSortKeys, type RunSourcePayload, type RunSourceProps, type RunSourceResponse, type RunStatus, type RunTaskProps, type RunTaskV1Props, type RunType, type ScheduleTrigger, type ScheduleTriggerInput, type ScheduleTriggerType, type ShopifyInput, type ShopifyMarket, type ShopifyMetafield, type Source, type SourceBigCommerce, type SourceBigQuery, type SourceCSV, type SourceCommercetools, type SourceCreate, type SourceCreateResponse, type SourceDocker, type SourceGA4BigQueryExport, type SourceInput, type SourceJSON, type SourceSearch, type SourceShopify, type SourceShopifyBase, type SourceSortKeys, type SourceType, type SourceUpdate, type SourceUpdateCommercetools, type SourceUpdateDocker, type SourceUpdateInput, type SourceUpdateResponse, type SourceUpdateShopify, type StreamingInput, type StreamingTrigger, type StreamingTriggerType, type SubscriptionTrigger, type SubscriptionTriggerType, type Task, type TaskCreate, type TaskCreateResponse, type TaskCreateTrigger, type TaskCreateV1, type TaskInput, type TaskSearch, type TaskSortKeys, type TaskUpdate, type TaskUpdateResponse, type TaskUpdateV1, type TaskV1, type Transformation, type TransformationCode, type TransformationCreate, type TransformationCreateResponse, type TransformationError, type TransformationInput, type TransformationNoCode, type TransformationSearch, type TransformationSortKeys, type TransformationTry, type TransformationTryResponse, type TransformationType, type TransformationUpdateResponse, type Trigger, type TriggerDockerSourceDiscoverProps, type TriggerType, type TriggerUpdateInput, type TryTransformationBeforeUpdateProps, type UpdateAuthenticationProps, type UpdateDestinationProps, type UpdateSourceProps, type UpdateTaskProps, type UpdateTaskV1Props, type UpdateTransformationProps, type ValidateSourceBeforeUpdateProps, type WatchResponse, type Window, apiClientVersion, ingestionClient, isOnDemandTrigger, isScheduleTrigger, isSubscriptionTrigger };
package/dist/node.d.cts CHANGED
@@ -1477,6 +1477,11 @@ type WatchResponse = {
1477
1477
  createdAt?: string | undefined;
1478
1478
  };
1479
1479
 
1480
+ /**
1481
+ * Type of indexing operation.
1482
+ */
1483
+ type Action = 'addObject' | 'updateObject' | 'partialUpdateObject' | 'partialUpdateObjectNoCreate' | 'deleteObject' | 'delete' | 'clear';
1484
+
1480
1485
  /**
1481
1486
  * Property by which to sort the list of authentications.
1482
1487
  */
@@ -1534,11 +1539,6 @@ type PlatformNone = 'none';
1534
1539
 
1535
1540
  type PlatformWithNone = Platform | PlatformNone;
1536
1541
 
1537
- /**
1538
- * Type of indexing operation.
1539
- */
1540
- type Action = 'addObject' | 'updateObject' | 'partialUpdateObject' | 'partialUpdateObjectNoCreate' | 'deleteObject' | 'delete' | 'clear';
1541
-
1542
1542
  type PushTaskRecords = Record<string, any> & {
1543
1543
  /**
1544
1544
  * Unique record identifier.
@@ -1697,7 +1697,7 @@ type TriggerType = 'onDemand' | 'schedule' | 'subscription' | 'streaming';
1697
1697
  */
1698
1698
  type CustomDeleteProps = {
1699
1699
  /**
1700
- * Path of the endpoint, anything after \"/1\" must be specified.
1700
+ * Path of the endpoint, for example `1/newFeature`.
1701
1701
  */
1702
1702
  path: string;
1703
1703
  /**
@@ -1712,7 +1712,7 @@ type CustomDeleteProps = {
1712
1712
  */
1713
1713
  type CustomGetProps = {
1714
1714
  /**
1715
- * Path of the endpoint, anything after \"/1\" must be specified.
1715
+ * Path of the endpoint, for example `1/newFeature`.
1716
1716
  */
1717
1717
  path: string;
1718
1718
  /**
@@ -1727,7 +1727,7 @@ type CustomGetProps = {
1727
1727
  */
1728
1728
  type CustomPostProps = {
1729
1729
  /**
1730
- * Path of the endpoint, anything after \"/1\" must be specified.
1730
+ * Path of the endpoint, for example `1/newFeature`.
1731
1731
  */
1732
1732
  path: string;
1733
1733
  /**
@@ -1746,7 +1746,7 @@ type CustomPostProps = {
1746
1746
  */
1747
1747
  type CustomPutProps = {
1748
1748
  /**
1749
- * Path of the endpoint, anything after \"/1\" must be specified.
1749
+ * Path of the endpoint, for example `1/newFeature`.
1750
1750
  */
1751
1751
  path: string;
1752
1752
  /**
@@ -2362,8 +2362,34 @@ type ValidateSourceBeforeUpdateProps = {
2362
2362
  sourceID: string;
2363
2363
  sourceUpdate: SourceUpdate;
2364
2364
  };
2365
+ type ChunkedPushOptions = {
2366
+ /**
2367
+ * The `indexName` to replace `objects` in.
2368
+ */
2369
+ indexName: string;
2370
+ /**
2371
+ * The `batch` `action` to perform on the given array of `objects`, defaults to `addObject`.
2372
+ */
2373
+ action?: Action | undefined;
2374
+ /**
2375
+ * Whether or not we should wait until every `batch` tasks has been processed, this operation may slow the total execution time of this method but is more reliable.
2376
+ */
2377
+ waitForTasks?: boolean | undefined;
2378
+ /**
2379
+ * The size of the chunk of `objects`. The number of `batch` calls will be equal to `length(objects) / batchSize`. Defaults to 1000.
2380
+ */
2381
+ batchSize?: number | undefined;
2382
+ /**
2383
+ * 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).
2384
+ */
2385
+ referenceIndexName?: string | undefined;
2386
+ /**
2387
+ * The array of `objects` to store in the given Algolia `indexName`.
2388
+ */
2389
+ objects: Array<Record<string, unknown>>;
2390
+ };
2365
2391
 
2366
- declare const apiClientVersion = "1.28.0";
2392
+ declare const apiClientVersion = "1.30.0";
2367
2393
  declare const REGIONS: readonly ["eu", "us"];
2368
2394
  type Region = (typeof REGIONS)[number];
2369
2395
  type RegionOptions = {
@@ -2424,6 +2450,20 @@ declare function createIngestionClient({ appId: appIdOption, apiKey: apiKeyOptio
2424
2450
  setClientApiKey({ apiKey }: {
2425
2451
  apiKey: string;
2426
2452
  }): void;
2453
+ /**
2454
+ * Helper: Chunks the given `objects` list in subset of 1000 elements max in order to make it fit in `push` requests by leveraging the Transformation pipeline setup in the Push connector (https://www.algolia.com/doc/guides/sending-and-managing-data/send-and-update-your-data/connectors/push/).
2455
+ *
2456
+ * @summary Helper: Chunks the given `objects` list in subset of 1000 elements max in order to make it fit in `batch` requests.
2457
+ * @param chunkedPush - The `chunkedPush` object.
2458
+ * @param chunkedPush.indexName - The `indexName` to replace `objects` in.
2459
+ * @param chunkedPush.objects - The array of `objects` to store in the given Algolia `indexName`.
2460
+ * @param chunkedPush.action - The `batch` `action` to perform on the given array of `objects`, defaults to `addObject`.
2461
+ * @param chunkedPush.waitForTasks - Whether or not we should wait until every `batch` tasks has been processed, this operation may slow the total execution time of this method but is more reliable.
2462
+ * @param chunkedPush.batchSize - The size of the chunk of `objects`. The number of `batch` calls will be equal to `length(objects) / batchSize`. Defaults to 1000.
2463
+ * @param chunkedPush.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).
2464
+ * @param requestOptions - The requestOptions to send along with the query, they will be forwarded to the `getEvent` method and merged with the transporter requestOptions.
2465
+ */
2466
+ chunkedPush({ indexName, objects, action, waitForTasks, batchSize, referenceIndexName, }: ChunkedPushOptions, requestOptions?: RequestOptions): Promise<Array<WatchResponse>>;
2427
2467
  /**
2428
2468
  * Creates a new authentication resource.
2429
2469
  *
@@ -2480,7 +2520,7 @@ declare function createIngestionClient({ appId: appIdOption, apiKey: apiKeyOptio
2480
2520
  /**
2481
2521
  * This method lets you send requests to the Algolia REST API.
2482
2522
  * @param customDelete - The customDelete object.
2483
- * @param customDelete.path - Path of the endpoint, anything after \"/1\" must be specified.
2523
+ * @param customDelete.path - Path of the endpoint, for example `1/newFeature`.
2484
2524
  * @param customDelete.parameters - Query parameters to apply to the current query.
2485
2525
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
2486
2526
  */
@@ -2488,7 +2528,7 @@ declare function createIngestionClient({ appId: appIdOption, apiKey: apiKeyOptio
2488
2528
  /**
2489
2529
  * This method lets you send requests to the Algolia REST API.
2490
2530
  * @param customGet - The customGet object.
2491
- * @param customGet.path - Path of the endpoint, anything after \"/1\" must be specified.
2531
+ * @param customGet.path - Path of the endpoint, for example `1/newFeature`.
2492
2532
  * @param customGet.parameters - Query parameters to apply to the current query.
2493
2533
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
2494
2534
  */
@@ -2496,7 +2536,7 @@ declare function createIngestionClient({ appId: appIdOption, apiKey: apiKeyOptio
2496
2536
  /**
2497
2537
  * This method lets you send requests to the Algolia REST API.
2498
2538
  * @param customPost - The customPost object.
2499
- * @param customPost.path - Path of the endpoint, anything after \"/1\" must be specified.
2539
+ * @param customPost.path - Path of the endpoint, for example `1/newFeature`.
2500
2540
  * @param customPost.parameters - Query parameters to apply to the current query.
2501
2541
  * @param customPost.body - Parameters to send with the custom request.
2502
2542
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
@@ -2505,7 +2545,7 @@ declare function createIngestionClient({ appId: appIdOption, apiKey: apiKeyOptio
2505
2545
  /**
2506
2546
  * This method lets you send requests to the Algolia REST API.
2507
2547
  * @param customPut - The customPut object.
2508
- * @param customPut.path - Path of the endpoint, anything after \"/1\" must be specified.
2548
+ * @param customPut.path - Path of the endpoint, for example `1/newFeature`.
2509
2549
  * @param customPut.parameters - Query parameters to apply to the current query.
2510
2550
  * @param customPut.body - Parameters to send with the custom request.
2511
2551
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
@@ -3146,4 +3186,4 @@ type IngestionClient = ReturnType<typeof createIngestionClient>;
3146
3186
 
3147
3187
  declare function ingestionClient(appId: string, apiKey: string, region: Region, options?: ClientOptions | undefined): IngestionClient;
3148
3188
 
3149
- export { type Action, type ActionType, type AuthAPIKey, type AuthAPIKeyPartial, type AuthAlgolia, type AuthAlgoliaInsights, type AuthAlgoliaInsightsPartial, type AuthAlgoliaPartial, type AuthBasic, type AuthBasicPartial, type AuthGoogleServiceAccount, type AuthGoogleServiceAccountPartial, type AuthInput, type AuthInputPartial, type AuthOAuth, type AuthOAuthPartial, type Authentication, type AuthenticationCreate, type AuthenticationCreateResponse, type AuthenticationSearch, type AuthenticationSortKeys, type AuthenticationType, type AuthenticationUpdate, type AuthenticationUpdateResponse, type BigCommerceChannel, type BigCommerceMetafield, type BigQueryDataType, type CommercetoolsCustomFields, type CustomDeleteProps, type CustomGetProps, type CustomPostProps, type CustomPutProps, type DeleteAuthenticationProps, type DeleteDestinationProps, type DeleteResponse, type DeleteSourceProps, type DeleteTaskProps, type DeleteTaskV1Props, type DeleteTransformationProps, type Destination, type DestinationCreate, type DestinationCreateResponse, type DestinationInput, type DestinationSearch, type DestinationSortKeys, type DestinationType, type DestinationUpdate, type DestinationUpdateResponse, type DisableTaskProps, type DisableTaskV1Props, type DockerStreams, type DockerStreamsInput, type DockerStreamsSyncMode, type EmailNotifications, type EnableTaskProps, type EnableTaskV1Props, type EntityType, type ErrorBase, type Event, type EventSortKeys, type EventStatus, type EventType, type GetAuthenticationProps, type GetDestinationProps, type GetEventProps, type GetRunProps, type GetSourceProps, type GetTaskProps, type GetTaskV1Props, type GetTransformationProps, type IngestionClient, type ListAuthenticationsProps, type ListAuthenticationsResponse, type ListDestinationsProps, type ListDestinationsResponse, type ListEventsProps, type ListEventsResponse, type ListRunsProps, type ListSourcesProps, type ListSourcesResponse, type ListTasksProps, type ListTasksResponse, type ListTasksResponseV1, type ListTasksV1Props, type ListTransformationsProps, type ListTransformationsResponse, type MappingFieldDirective, type MappingFormatSchema, type MappingInput, type MappingKitAction, type MappingTypeCSV, type MethodType, type Notifications, type OnDemandTrigger, type OnDemandTriggerInput, type OnDemandTriggerType, type OrderKeys, type Pagination, type Platform, type PlatformNone, type PlatformWithNone, type Policies, type PushProps, type PushTaskPayload, type PushTaskProps, type PushTaskRecords, type RecordType, type Region, type RegionOptions, type Run, type RunListResponse, type RunOutcome, type RunProgress, type RunReasonCode, type RunResponse, type RunSortKeys, type RunSourcePayload, type RunSourceProps, type RunSourceResponse, type RunStatus, type RunTaskProps, type RunTaskV1Props, type RunType, type ScheduleTrigger, type ScheduleTriggerInput, type ScheduleTriggerType, type ShopifyInput, type ShopifyMarket, type ShopifyMetafield, type Source, type SourceBigCommerce, type SourceBigQuery, type SourceCSV, type SourceCommercetools, type SourceCreate, type SourceCreateResponse, type SourceDocker, type SourceGA4BigQueryExport, type SourceInput, type SourceJSON, type SourceSearch, type SourceShopify, type SourceShopifyBase, type SourceSortKeys, type SourceType, type SourceUpdate, type SourceUpdateCommercetools, type SourceUpdateDocker, type SourceUpdateInput, type SourceUpdateResponse, type SourceUpdateShopify, type StreamingInput, type StreamingTrigger, type StreamingTriggerType, type SubscriptionTrigger, type SubscriptionTriggerType, type Task, type TaskCreate, type TaskCreateResponse, type TaskCreateTrigger, type TaskCreateV1, type TaskInput, type TaskSearch, type TaskSortKeys, type TaskUpdate, type TaskUpdateResponse, type TaskUpdateV1, type TaskV1, type Transformation, type TransformationCode, type TransformationCreate, type TransformationCreateResponse, type TransformationError, type TransformationInput, type TransformationNoCode, type TransformationSearch, type TransformationSortKeys, type TransformationTry, type TransformationTryResponse, type TransformationType, type TransformationUpdateResponse, type Trigger, type TriggerDockerSourceDiscoverProps, type TriggerType, type TriggerUpdateInput, type TryTransformationBeforeUpdateProps, type UpdateAuthenticationProps, type UpdateDestinationProps, type UpdateSourceProps, type UpdateTaskProps, type UpdateTaskV1Props, type UpdateTransformationProps, type ValidateSourceBeforeUpdateProps, type WatchResponse, type Window, apiClientVersion, ingestionClient, isOnDemandTrigger, isScheduleTrigger, isSubscriptionTrigger };
3189
+ export { type Action, type ActionType, type AuthAPIKey, type AuthAPIKeyPartial, type AuthAlgolia, type AuthAlgoliaInsights, type AuthAlgoliaInsightsPartial, type AuthAlgoliaPartial, type AuthBasic, type AuthBasicPartial, type AuthGoogleServiceAccount, type AuthGoogleServiceAccountPartial, type AuthInput, type AuthInputPartial, type AuthOAuth, type AuthOAuthPartial, type Authentication, type AuthenticationCreate, type AuthenticationCreateResponse, type AuthenticationSearch, type AuthenticationSortKeys, type AuthenticationType, type AuthenticationUpdate, type AuthenticationUpdateResponse, type BigCommerceChannel, type BigCommerceMetafield, type BigQueryDataType, type ChunkedPushOptions, type CommercetoolsCustomFields, type CustomDeleteProps, type CustomGetProps, type CustomPostProps, type CustomPutProps, type DeleteAuthenticationProps, type DeleteDestinationProps, type DeleteResponse, type DeleteSourceProps, type DeleteTaskProps, type DeleteTaskV1Props, type DeleteTransformationProps, type Destination, type DestinationCreate, type DestinationCreateResponse, type DestinationInput, type DestinationSearch, type DestinationSortKeys, type DestinationType, type DestinationUpdate, type DestinationUpdateResponse, type DisableTaskProps, type DisableTaskV1Props, type DockerStreams, type DockerStreamsInput, type DockerStreamsSyncMode, type EmailNotifications, type EnableTaskProps, type EnableTaskV1Props, type EntityType, type ErrorBase, type Event, type EventSortKeys, type EventStatus, type EventType, type GetAuthenticationProps, type GetDestinationProps, type GetEventProps, type GetRunProps, type GetSourceProps, type GetTaskProps, type GetTaskV1Props, type GetTransformationProps, type IngestionClient, type ListAuthenticationsProps, type ListAuthenticationsResponse, type ListDestinationsProps, type ListDestinationsResponse, type ListEventsProps, type ListEventsResponse, type ListRunsProps, type ListSourcesProps, type ListSourcesResponse, type ListTasksProps, type ListTasksResponse, type ListTasksResponseV1, type ListTasksV1Props, type ListTransformationsProps, type ListTransformationsResponse, type MappingFieldDirective, type MappingFormatSchema, type MappingInput, type MappingKitAction, type MappingTypeCSV, type MethodType, type Notifications, type OnDemandTrigger, type OnDemandTriggerInput, type OnDemandTriggerType, type OrderKeys, type Pagination, type Platform, type PlatformNone, type PlatformWithNone, type Policies, type PushProps, type PushTaskPayload, type PushTaskProps, type PushTaskRecords, type RecordType, type Region, type RegionOptions, type Run, type RunListResponse, type RunOutcome, type RunProgress, type RunReasonCode, type RunResponse, type RunSortKeys, type RunSourcePayload, type RunSourceProps, type RunSourceResponse, type RunStatus, type RunTaskProps, type RunTaskV1Props, type RunType, type ScheduleTrigger, type ScheduleTriggerInput, type ScheduleTriggerType, type ShopifyInput, type ShopifyMarket, type ShopifyMetafield, type Source, type SourceBigCommerce, type SourceBigQuery, type SourceCSV, type SourceCommercetools, type SourceCreate, type SourceCreateResponse, type SourceDocker, type SourceGA4BigQueryExport, type SourceInput, type SourceJSON, type SourceSearch, type SourceShopify, type SourceShopifyBase, type SourceSortKeys, type SourceType, type SourceUpdate, type SourceUpdateCommercetools, type SourceUpdateDocker, type SourceUpdateInput, type SourceUpdateResponse, type SourceUpdateShopify, type StreamingInput, type StreamingTrigger, type StreamingTriggerType, type SubscriptionTrigger, type SubscriptionTriggerType, type Task, type TaskCreate, type TaskCreateResponse, type TaskCreateTrigger, type TaskCreateV1, type TaskInput, type TaskSearch, type TaskSortKeys, type TaskUpdate, type TaskUpdateResponse, type TaskUpdateV1, type TaskV1, type Transformation, type TransformationCode, type TransformationCreate, type TransformationCreateResponse, type TransformationError, type TransformationInput, type TransformationNoCode, type TransformationSearch, type TransformationSortKeys, type TransformationTry, type TransformationTryResponse, type TransformationType, type TransformationUpdateResponse, type Trigger, type TriggerDockerSourceDiscoverProps, type TriggerType, type TriggerUpdateInput, type TryTransformationBeforeUpdateProps, type UpdateAuthenticationProps, type UpdateDestinationProps, type UpdateSourceProps, type UpdateTaskProps, type UpdateTaskV1Props, type UpdateTransformationProps, type ValidateSourceBeforeUpdateProps, type WatchResponse, type Window, apiClientVersion, ingestionClient, isOnDemandTrigger, isScheduleTrigger, isSubscriptionTrigger };
package/dist/node.d.ts CHANGED
@@ -1477,6 +1477,11 @@ type WatchResponse = {
1477
1477
  createdAt?: string | undefined;
1478
1478
  };
1479
1479
 
1480
+ /**
1481
+ * Type of indexing operation.
1482
+ */
1483
+ type Action = 'addObject' | 'updateObject' | 'partialUpdateObject' | 'partialUpdateObjectNoCreate' | 'deleteObject' | 'delete' | 'clear';
1484
+
1480
1485
  /**
1481
1486
  * Property by which to sort the list of authentications.
1482
1487
  */
@@ -1534,11 +1539,6 @@ type PlatformNone = 'none';
1534
1539
 
1535
1540
  type PlatformWithNone = Platform | PlatformNone;
1536
1541
 
1537
- /**
1538
- * Type of indexing operation.
1539
- */
1540
- type Action = 'addObject' | 'updateObject' | 'partialUpdateObject' | 'partialUpdateObjectNoCreate' | 'deleteObject' | 'delete' | 'clear';
1541
-
1542
1542
  type PushTaskRecords = Record<string, any> & {
1543
1543
  /**
1544
1544
  * Unique record identifier.
@@ -1697,7 +1697,7 @@ type TriggerType = 'onDemand' | 'schedule' | 'subscription' | 'streaming';
1697
1697
  */
1698
1698
  type CustomDeleteProps = {
1699
1699
  /**
1700
- * Path of the endpoint, anything after \"/1\" must be specified.
1700
+ * Path of the endpoint, for example `1/newFeature`.
1701
1701
  */
1702
1702
  path: string;
1703
1703
  /**
@@ -1712,7 +1712,7 @@ type CustomDeleteProps = {
1712
1712
  */
1713
1713
  type CustomGetProps = {
1714
1714
  /**
1715
- * Path of the endpoint, anything after \"/1\" must be specified.
1715
+ * Path of the endpoint, for example `1/newFeature`.
1716
1716
  */
1717
1717
  path: string;
1718
1718
  /**
@@ -1727,7 +1727,7 @@ type CustomGetProps = {
1727
1727
  */
1728
1728
  type CustomPostProps = {
1729
1729
  /**
1730
- * Path of the endpoint, anything after \"/1\" must be specified.
1730
+ * Path of the endpoint, for example `1/newFeature`.
1731
1731
  */
1732
1732
  path: string;
1733
1733
  /**
@@ -1746,7 +1746,7 @@ type CustomPostProps = {
1746
1746
  */
1747
1747
  type CustomPutProps = {
1748
1748
  /**
1749
- * Path of the endpoint, anything after \"/1\" must be specified.
1749
+ * Path of the endpoint, for example `1/newFeature`.
1750
1750
  */
1751
1751
  path: string;
1752
1752
  /**
@@ -2362,8 +2362,34 @@ type ValidateSourceBeforeUpdateProps = {
2362
2362
  sourceID: string;
2363
2363
  sourceUpdate: SourceUpdate;
2364
2364
  };
2365
+ type ChunkedPushOptions = {
2366
+ /**
2367
+ * The `indexName` to replace `objects` in.
2368
+ */
2369
+ indexName: string;
2370
+ /**
2371
+ * The `batch` `action` to perform on the given array of `objects`, defaults to `addObject`.
2372
+ */
2373
+ action?: Action | undefined;
2374
+ /**
2375
+ * Whether or not we should wait until every `batch` tasks has been processed, this operation may slow the total execution time of this method but is more reliable.
2376
+ */
2377
+ waitForTasks?: boolean | undefined;
2378
+ /**
2379
+ * The size of the chunk of `objects`. The number of `batch` calls will be equal to `length(objects) / batchSize`. Defaults to 1000.
2380
+ */
2381
+ batchSize?: number | undefined;
2382
+ /**
2383
+ * 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).
2384
+ */
2385
+ referenceIndexName?: string | undefined;
2386
+ /**
2387
+ * The array of `objects` to store in the given Algolia `indexName`.
2388
+ */
2389
+ objects: Array<Record<string, unknown>>;
2390
+ };
2365
2391
 
2366
- declare const apiClientVersion = "1.28.0";
2392
+ declare const apiClientVersion = "1.30.0";
2367
2393
  declare const REGIONS: readonly ["eu", "us"];
2368
2394
  type Region = (typeof REGIONS)[number];
2369
2395
  type RegionOptions = {
@@ -2424,6 +2450,20 @@ declare function createIngestionClient({ appId: appIdOption, apiKey: apiKeyOptio
2424
2450
  setClientApiKey({ apiKey }: {
2425
2451
  apiKey: string;
2426
2452
  }): void;
2453
+ /**
2454
+ * Helper: Chunks the given `objects` list in subset of 1000 elements max in order to make it fit in `push` requests by leveraging the Transformation pipeline setup in the Push connector (https://www.algolia.com/doc/guides/sending-and-managing-data/send-and-update-your-data/connectors/push/).
2455
+ *
2456
+ * @summary Helper: Chunks the given `objects` list in subset of 1000 elements max in order to make it fit in `batch` requests.
2457
+ * @param chunkedPush - The `chunkedPush` object.
2458
+ * @param chunkedPush.indexName - The `indexName` to replace `objects` in.
2459
+ * @param chunkedPush.objects - The array of `objects` to store in the given Algolia `indexName`.
2460
+ * @param chunkedPush.action - The `batch` `action` to perform on the given array of `objects`, defaults to `addObject`.
2461
+ * @param chunkedPush.waitForTasks - Whether or not we should wait until every `batch` tasks has been processed, this operation may slow the total execution time of this method but is more reliable.
2462
+ * @param chunkedPush.batchSize - The size of the chunk of `objects`. The number of `batch` calls will be equal to `length(objects) / batchSize`. Defaults to 1000.
2463
+ * @param chunkedPush.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).
2464
+ * @param requestOptions - The requestOptions to send along with the query, they will be forwarded to the `getEvent` method and merged with the transporter requestOptions.
2465
+ */
2466
+ chunkedPush({ indexName, objects, action, waitForTasks, batchSize, referenceIndexName, }: ChunkedPushOptions, requestOptions?: RequestOptions): Promise<Array<WatchResponse>>;
2427
2467
  /**
2428
2468
  * Creates a new authentication resource.
2429
2469
  *
@@ -2480,7 +2520,7 @@ declare function createIngestionClient({ appId: appIdOption, apiKey: apiKeyOptio
2480
2520
  /**
2481
2521
  * This method lets you send requests to the Algolia REST API.
2482
2522
  * @param customDelete - The customDelete object.
2483
- * @param customDelete.path - Path of the endpoint, anything after \"/1\" must be specified.
2523
+ * @param customDelete.path - Path of the endpoint, for example `1/newFeature`.
2484
2524
  * @param customDelete.parameters - Query parameters to apply to the current query.
2485
2525
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
2486
2526
  */
@@ -2488,7 +2528,7 @@ declare function createIngestionClient({ appId: appIdOption, apiKey: apiKeyOptio
2488
2528
  /**
2489
2529
  * This method lets you send requests to the Algolia REST API.
2490
2530
  * @param customGet - The customGet object.
2491
- * @param customGet.path - Path of the endpoint, anything after \"/1\" must be specified.
2531
+ * @param customGet.path - Path of the endpoint, for example `1/newFeature`.
2492
2532
  * @param customGet.parameters - Query parameters to apply to the current query.
2493
2533
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
2494
2534
  */
@@ -2496,7 +2536,7 @@ declare function createIngestionClient({ appId: appIdOption, apiKey: apiKeyOptio
2496
2536
  /**
2497
2537
  * This method lets you send requests to the Algolia REST API.
2498
2538
  * @param customPost - The customPost object.
2499
- * @param customPost.path - Path of the endpoint, anything after \"/1\" must be specified.
2539
+ * @param customPost.path - Path of the endpoint, for example `1/newFeature`.
2500
2540
  * @param customPost.parameters - Query parameters to apply to the current query.
2501
2541
  * @param customPost.body - Parameters to send with the custom request.
2502
2542
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
@@ -2505,7 +2545,7 @@ declare function createIngestionClient({ appId: appIdOption, apiKey: apiKeyOptio
2505
2545
  /**
2506
2546
  * This method lets you send requests to the Algolia REST API.
2507
2547
  * @param customPut - The customPut object.
2508
- * @param customPut.path - Path of the endpoint, anything after \"/1\" must be specified.
2548
+ * @param customPut.path - Path of the endpoint, for example `1/newFeature`.
2509
2549
  * @param customPut.parameters - Query parameters to apply to the current query.
2510
2550
  * @param customPut.body - Parameters to send with the custom request.
2511
2551
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
@@ -3146,4 +3186,4 @@ type IngestionClient = ReturnType<typeof createIngestionClient>;
3146
3186
 
3147
3187
  declare function ingestionClient(appId: string, apiKey: string, region: Region, options?: ClientOptions | undefined): IngestionClient;
3148
3188
 
3149
- export { type Action, type ActionType, type AuthAPIKey, type AuthAPIKeyPartial, type AuthAlgolia, type AuthAlgoliaInsights, type AuthAlgoliaInsightsPartial, type AuthAlgoliaPartial, type AuthBasic, type AuthBasicPartial, type AuthGoogleServiceAccount, type AuthGoogleServiceAccountPartial, type AuthInput, type AuthInputPartial, type AuthOAuth, type AuthOAuthPartial, type Authentication, type AuthenticationCreate, type AuthenticationCreateResponse, type AuthenticationSearch, type AuthenticationSortKeys, type AuthenticationType, type AuthenticationUpdate, type AuthenticationUpdateResponse, type BigCommerceChannel, type BigCommerceMetafield, type BigQueryDataType, type CommercetoolsCustomFields, type CustomDeleteProps, type CustomGetProps, type CustomPostProps, type CustomPutProps, type DeleteAuthenticationProps, type DeleteDestinationProps, type DeleteResponse, type DeleteSourceProps, type DeleteTaskProps, type DeleteTaskV1Props, type DeleteTransformationProps, type Destination, type DestinationCreate, type DestinationCreateResponse, type DestinationInput, type DestinationSearch, type DestinationSortKeys, type DestinationType, type DestinationUpdate, type DestinationUpdateResponse, type DisableTaskProps, type DisableTaskV1Props, type DockerStreams, type DockerStreamsInput, type DockerStreamsSyncMode, type EmailNotifications, type EnableTaskProps, type EnableTaskV1Props, type EntityType, type ErrorBase, type Event, type EventSortKeys, type EventStatus, type EventType, type GetAuthenticationProps, type GetDestinationProps, type GetEventProps, type GetRunProps, type GetSourceProps, type GetTaskProps, type GetTaskV1Props, type GetTransformationProps, type IngestionClient, type ListAuthenticationsProps, type ListAuthenticationsResponse, type ListDestinationsProps, type ListDestinationsResponse, type ListEventsProps, type ListEventsResponse, type ListRunsProps, type ListSourcesProps, type ListSourcesResponse, type ListTasksProps, type ListTasksResponse, type ListTasksResponseV1, type ListTasksV1Props, type ListTransformationsProps, type ListTransformationsResponse, type MappingFieldDirective, type MappingFormatSchema, type MappingInput, type MappingKitAction, type MappingTypeCSV, type MethodType, type Notifications, type OnDemandTrigger, type OnDemandTriggerInput, type OnDemandTriggerType, type OrderKeys, type Pagination, type Platform, type PlatformNone, type PlatformWithNone, type Policies, type PushProps, type PushTaskPayload, type PushTaskProps, type PushTaskRecords, type RecordType, type Region, type RegionOptions, type Run, type RunListResponse, type RunOutcome, type RunProgress, type RunReasonCode, type RunResponse, type RunSortKeys, type RunSourcePayload, type RunSourceProps, type RunSourceResponse, type RunStatus, type RunTaskProps, type RunTaskV1Props, type RunType, type ScheduleTrigger, type ScheduleTriggerInput, type ScheduleTriggerType, type ShopifyInput, type ShopifyMarket, type ShopifyMetafield, type Source, type SourceBigCommerce, type SourceBigQuery, type SourceCSV, type SourceCommercetools, type SourceCreate, type SourceCreateResponse, type SourceDocker, type SourceGA4BigQueryExport, type SourceInput, type SourceJSON, type SourceSearch, type SourceShopify, type SourceShopifyBase, type SourceSortKeys, type SourceType, type SourceUpdate, type SourceUpdateCommercetools, type SourceUpdateDocker, type SourceUpdateInput, type SourceUpdateResponse, type SourceUpdateShopify, type StreamingInput, type StreamingTrigger, type StreamingTriggerType, type SubscriptionTrigger, type SubscriptionTriggerType, type Task, type TaskCreate, type TaskCreateResponse, type TaskCreateTrigger, type TaskCreateV1, type TaskInput, type TaskSearch, type TaskSortKeys, type TaskUpdate, type TaskUpdateResponse, type TaskUpdateV1, type TaskV1, type Transformation, type TransformationCode, type TransformationCreate, type TransformationCreateResponse, type TransformationError, type TransformationInput, type TransformationNoCode, type TransformationSearch, type TransformationSortKeys, type TransformationTry, type TransformationTryResponse, type TransformationType, type TransformationUpdateResponse, type Trigger, type TriggerDockerSourceDiscoverProps, type TriggerType, type TriggerUpdateInput, type TryTransformationBeforeUpdateProps, type UpdateAuthenticationProps, type UpdateDestinationProps, type UpdateSourceProps, type UpdateTaskProps, type UpdateTaskV1Props, type UpdateTransformationProps, type ValidateSourceBeforeUpdateProps, type WatchResponse, type Window, apiClientVersion, ingestionClient, isOnDemandTrigger, isScheduleTrigger, isSubscriptionTrigger };
3189
+ export { type Action, type ActionType, type AuthAPIKey, type AuthAPIKeyPartial, type AuthAlgolia, type AuthAlgoliaInsights, type AuthAlgoliaInsightsPartial, type AuthAlgoliaPartial, type AuthBasic, type AuthBasicPartial, type AuthGoogleServiceAccount, type AuthGoogleServiceAccountPartial, type AuthInput, type AuthInputPartial, type AuthOAuth, type AuthOAuthPartial, type Authentication, type AuthenticationCreate, type AuthenticationCreateResponse, type AuthenticationSearch, type AuthenticationSortKeys, type AuthenticationType, type AuthenticationUpdate, type AuthenticationUpdateResponse, type BigCommerceChannel, type BigCommerceMetafield, type BigQueryDataType, type ChunkedPushOptions, type CommercetoolsCustomFields, type CustomDeleteProps, type CustomGetProps, type CustomPostProps, type CustomPutProps, type DeleteAuthenticationProps, type DeleteDestinationProps, type DeleteResponse, type DeleteSourceProps, type DeleteTaskProps, type DeleteTaskV1Props, type DeleteTransformationProps, type Destination, type DestinationCreate, type DestinationCreateResponse, type DestinationInput, type DestinationSearch, type DestinationSortKeys, type DestinationType, type DestinationUpdate, type DestinationUpdateResponse, type DisableTaskProps, type DisableTaskV1Props, type DockerStreams, type DockerStreamsInput, type DockerStreamsSyncMode, type EmailNotifications, type EnableTaskProps, type EnableTaskV1Props, type EntityType, type ErrorBase, type Event, type EventSortKeys, type EventStatus, type EventType, type GetAuthenticationProps, type GetDestinationProps, type GetEventProps, type GetRunProps, type GetSourceProps, type GetTaskProps, type GetTaskV1Props, type GetTransformationProps, type IngestionClient, type ListAuthenticationsProps, type ListAuthenticationsResponse, type ListDestinationsProps, type ListDestinationsResponse, type ListEventsProps, type ListEventsResponse, type ListRunsProps, type ListSourcesProps, type ListSourcesResponse, type ListTasksProps, type ListTasksResponse, type ListTasksResponseV1, type ListTasksV1Props, type ListTransformationsProps, type ListTransformationsResponse, type MappingFieldDirective, type MappingFormatSchema, type MappingInput, type MappingKitAction, type MappingTypeCSV, type MethodType, type Notifications, type OnDemandTrigger, type OnDemandTriggerInput, type OnDemandTriggerType, type OrderKeys, type Pagination, type Platform, type PlatformNone, type PlatformWithNone, type Policies, type PushProps, type PushTaskPayload, type PushTaskProps, type PushTaskRecords, type RecordType, type Region, type RegionOptions, type Run, type RunListResponse, type RunOutcome, type RunProgress, type RunReasonCode, type RunResponse, type RunSortKeys, type RunSourcePayload, type RunSourceProps, type RunSourceResponse, type RunStatus, type RunTaskProps, type RunTaskV1Props, type RunType, type ScheduleTrigger, type ScheduleTriggerInput, type ScheduleTriggerType, type ShopifyInput, type ShopifyMarket, type ShopifyMetafield, type Source, type SourceBigCommerce, type SourceBigQuery, type SourceCSV, type SourceCommercetools, type SourceCreate, type SourceCreateResponse, type SourceDocker, type SourceGA4BigQueryExport, type SourceInput, type SourceJSON, type SourceSearch, type SourceShopify, type SourceShopifyBase, type SourceSortKeys, type SourceType, type SourceUpdate, type SourceUpdateCommercetools, type SourceUpdateDocker, type SourceUpdateInput, type SourceUpdateResponse, type SourceUpdateShopify, type StreamingInput, type StreamingTrigger, type StreamingTriggerType, type SubscriptionTrigger, type SubscriptionTriggerType, type Task, type TaskCreate, type TaskCreateResponse, type TaskCreateTrigger, type TaskCreateV1, type TaskInput, type TaskSearch, type TaskSortKeys, type TaskUpdate, type TaskUpdateResponse, type TaskUpdateV1, type TaskV1, type Transformation, type TransformationCode, type TransformationCreate, type TransformationCreateResponse, type TransformationError, type TransformationInput, type TransformationNoCode, type TransformationSearch, type TransformationSortKeys, type TransformationTry, type TransformationTryResponse, type TransformationType, type TransformationUpdateResponse, type Trigger, type TriggerDockerSourceDiscoverProps, type TriggerType, type TriggerUpdateInput, type TryTransformationBeforeUpdateProps, type UpdateAuthenticationProps, type UpdateDestinationProps, type UpdateSourceProps, type UpdateTaskProps, type UpdateTaskV1Props, type UpdateTransformationProps, type ValidateSourceBeforeUpdateProps, type WatchResponse, type Window, apiClientVersion, ingestionClient, isOnDemandTrigger, isScheduleTrigger, isSubscriptionTrigger };
@@ -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.28.0";
32
+ var apiClientVersion = "1.30.0";
33
33
  var REGIONS = ["eu", "us"];
34
34
  function getDefaultHosts(region) {
35
35
  const url = "data.{region}.algolia.com".replace("{region}", region);
@@ -115,6 +115,69 @@ function createIngestionClient({
115
115
  transporter.baseQueryParameters["x-algolia-api-key"] = apiKey;
116
116
  }
117
117
  },
118
+ /**
119
+ * Helper: Chunks the given `objects` list in subset of 1000 elements max in order to make it fit in `push` requests by leveraging the Transformation pipeline setup in the Push connector (https://www.algolia.com/doc/guides/sending-and-managing-data/send-and-update-your-data/connectors/push/).
120
+ *
121
+ * @summary Helper: Chunks the given `objects` list in subset of 1000 elements max in order to make it fit in `batch` requests.
122
+ * @param chunkedPush - The `chunkedPush` object.
123
+ * @param chunkedPush.indexName - The `indexName` to replace `objects` in.
124
+ * @param chunkedPush.objects - The array of `objects` to store in the given Algolia `indexName`.
125
+ * @param chunkedPush.action - The `batch` `action` to perform on the given array of `objects`, defaults to `addObject`.
126
+ * @param chunkedPush.waitForTasks - Whether or not we should wait until every `batch` tasks has been processed, this operation may slow the total execution time of this method but is more reliable.
127
+ * @param chunkedPush.batchSize - The size of the chunk of `objects`. The number of `batch` calls will be equal to `length(objects) / batchSize`. Defaults to 1000.
128
+ * @param chunkedPush.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).
129
+ * @param requestOptions - The requestOptions to send along with the query, they will be forwarded to the `getEvent` method and merged with the transporter requestOptions.
130
+ */
131
+ async chunkedPush({
132
+ indexName,
133
+ objects,
134
+ action = "addObject",
135
+ waitForTasks,
136
+ batchSize = 1e3,
137
+ referenceIndexName
138
+ }, requestOptions) {
139
+ let records = [];
140
+ const responses = [];
141
+ const objectEntries = objects.entries();
142
+ for (const [i, obj] of objectEntries) {
143
+ records.push(obj);
144
+ if (records.length === batchSize || i === objects.length - 1) {
145
+ responses.push(
146
+ await this.push({ indexName, pushTaskPayload: { action, records }, referenceIndexName }, requestOptions)
147
+ );
148
+ records = [];
149
+ }
150
+ }
151
+ let retryCount = 0;
152
+ if (waitForTasks) {
153
+ for (const resp of responses) {
154
+ if (!resp.eventID) {
155
+ throw new Error("received unexpected response from the push endpoint, eventID must not be undefined");
156
+ }
157
+ await (0, import_client_common.createIterablePromise)({
158
+ func: async () => {
159
+ if (resp.eventID === void 0 || !resp.eventID) {
160
+ throw new Error("received unexpected response from the push endpoint, eventID must not be undefined");
161
+ }
162
+ return this.getEvent({ runID: resp.runID, eventID: resp.eventID }).catch((error) => {
163
+ if (error.status === 404) {
164
+ return void 0;
165
+ }
166
+ throw error;
167
+ });
168
+ },
169
+ validate: (response) => response !== void 0,
170
+ aggregator: () => retryCount += 1,
171
+ error: {
172
+ validate: () => retryCount >= 50,
173
+ message: () => `The maximum number of retries exceeded. (${retryCount}/${50})`
174
+ },
175
+ timeout: () => Math.min(retryCount * 500, 5e3)
176
+ });
177
+ }
178
+ }
179
+ return responses;
180
+ },
118
181
  /**
119
182
  * Creates a new authentication resource.
120
183
  *
@@ -309,7 +372,7 @@ function createIngestionClient({
309
372
  /**
310
373
  * This method lets you send requests to the Algolia REST API.
311
374
  * @param customDelete - The customDelete object.
312
- * @param customDelete.path - Path of the endpoint, anything after \"/1\" must be specified.
375
+ * @param customDelete.path - Path of the endpoint, for example `1/newFeature`.
313
376
  * @param customDelete.parameters - Query parameters to apply to the current query.
314
377
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
315
378
  */
@@ -331,7 +394,7 @@ function createIngestionClient({
331
394
  /**
332
395
  * This method lets you send requests to the Algolia REST API.
333
396
  * @param customGet - The customGet object.
334
- * @param customGet.path - Path of the endpoint, anything after \"/1\" must be specified.
397
+ * @param customGet.path - Path of the endpoint, for example `1/newFeature`.
335
398
  * @param customGet.parameters - Query parameters to apply to the current query.
336
399
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
337
400
  */
@@ -353,7 +416,7 @@ function createIngestionClient({
353
416
  /**
354
417
  * This method lets you send requests to the Algolia REST API.
355
418
  * @param customPost - The customPost object.
356
- * @param customPost.path - Path of the endpoint, anything after \"/1\" must be specified.
419
+ * @param customPost.path - Path of the endpoint, for example `1/newFeature`.
357
420
  * @param customPost.parameters - Query parameters to apply to the current query.
358
421
  * @param customPost.body - Parameters to send with the custom request.
359
422
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
@@ -377,7 +440,7 @@ function createIngestionClient({
377
440
  /**
378
441
  * This method lets you send requests to the Algolia REST API.
379
442
  * @param customPut - The customPut object.
380
- * @param customPut.path - Path of the endpoint, anything after \"/1\" must be specified.
443
+ * @param customPut.path - Path of the endpoint, for example `1/newFeature`.
381
444
  * @param customPut.parameters - Query parameters to apply to the current query.
382
445
  * @param customPut.body - Parameters to send with the custom request.
383
446
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.