Skip to content

Commit 78ed157

Browse files
feat(specs): add new ingestion property for push (generated)
algolia/api-clients-automation#5007 Co-authored-by: algolia-bot <accounts+algolia-api-client-bot@algolia.com> Co-authored-by: Clément Vannicatte <vannicattec@gmail.com>
1 parent 1ce0d21 commit 78ed157

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

packages/ingestion/model/clientMethodProps.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -593,6 +593,10 @@ export type PushProps = {
593593
* When provided, the push operation will be synchronous and the API will wait for the ingestion to be finished before responding.
594594
*/
595595
watch?: boolean | undefined;
596+
/**
597+
* 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).
598+
*/
599+
referenceIndexName?: string | undefined;
596600
};
597601

598602
/**

packages/ingestion/src/ingestionClient.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1714,9 +1714,13 @@ export function createIngestionClient({
17141714
* @param push.indexName - Name of the index on which to perform the operation.
17151715
* @param push.pushTaskPayload - The pushTaskPayload object.
17161716
* @param push.watch - When provided, the push operation will be synchronous and the API will wait for the ingestion to be finished before responding.
1717+
* @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).
17171718
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
17181719
*/
1719-
push({ indexName, pushTaskPayload, watch }: PushProps, requestOptions?: RequestOptions): Promise<WatchResponse> {
1720+
push(
1721+
{ indexName, pushTaskPayload, watch, referenceIndexName }: PushProps,
1722+
requestOptions?: RequestOptions,
1723+
): Promise<WatchResponse> {
17201724
if (!indexName) {
17211725
throw new Error('Parameter `indexName` is required when calling `push`.');
17221726
}
@@ -1740,6 +1744,10 @@ export function createIngestionClient({
17401744
queryParameters['watch'] = watch.toString();
17411745
}
17421746

1747+
if (referenceIndexName !== undefined) {
1748+
queryParameters['referenceIndexName'] = referenceIndexName.toString();
1749+
}
1750+
17431751
const request: Request = {
17441752
method: 'POST',
17451753
path: requestPath,

0 commit comments

Comments
 (0)