Skip to content

Commit

Permalink
fix(specs): enable watcher for push [skip-bc] (generated)
Browse files Browse the repository at this point in the history
algolia/api-clients-automation#4229

Co-authored-by: algolia-bot <accounts+algolia-api-client-bot@algolia.com>
Co-authored-by: Clément Vannicatte <vannicattec@gmail.com>
  • Loading branch information
algolia-bot and shortcuts committed Dec 11, 2024
1 parent 4f1e74e commit 47b97d9
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 8 deletions.
2 changes: 1 addition & 1 deletion packages/ingestion/model/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,6 @@ export * from './sourceUpdateDocker';
export * from './sourceUpdateInput';
export * from './sourceUpdateResponse';
export * from './sourceUpdateShopify';
export * from './sourceWatchResponse';
export * from './streamingInput';
export * from './streamingTrigger';
export * from './streamingTriggerType';
Expand Down Expand Up @@ -144,4 +143,5 @@ export * from './transformationUpdateResponse';
export * from './trigger';
export * from './triggerType';
export * from './triggerUpdateInput';
export * from './watchResponse';
export * from './window';
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@

import type { Event } from './event';

export type SourceWatchResponse = {
export type WatchResponse = {
/**
* Universally unique identifier (UUID) of a task run.
*/
runID?: string;

/**
* depending on the source type, the validation returns sampling data of your source (JSON, CSV, BigQuery).
* when used with discovering or validating sources, the sampled data of your source is returned.
*/
data?: Array<Record<string, unknown>>;

Expand Down
14 changes: 9 additions & 5 deletions packages/ingestion/src/ingestionClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ import type { SourceCreateResponse } from '../model/sourceCreateResponse';
import type { SourceSearch } from '../model/sourceSearch';

import type { SourceUpdateResponse } from '../model/sourceUpdateResponse';
import type { SourceWatchResponse } from '../model/sourceWatchResponse';
import type { Task } from '../model/task';
import type { TaskCreate } from '../model/taskCreate';
import type { TaskCreateResponse } from '../model/taskCreateResponse';
Expand All @@ -65,6 +64,8 @@ import type { TransformationTry } from '../model/transformationTry';
import type { TransformationTryResponse } from '../model/transformationTryResponse';
import type { TransformationUpdateResponse } from '../model/transformationUpdateResponse';

import type { WatchResponse } from '../model/watchResponse';

import type {
CustomDeleteProps,
CustomGetProps,
Expand Down Expand Up @@ -1694,7 +1695,10 @@ export function createIngestionClient({
* @param pushTask.watch - When provided, the push operation will be synchronous and the API will wait for the ingestion to be finished before responding.
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
*/
pushTask({ taskID, pushTaskPayload, watch }: PushTaskProps, requestOptions?: RequestOptions): Promise<RunResponse> {
pushTask(
{ taskID, pushTaskPayload, watch }: PushTaskProps,
requestOptions?: RequestOptions,
): Promise<WatchResponse> {
if (!taskID) {
throw new Error('Parameter `taskID` is required when calling `pushTask`.');
}
Expand Down Expand Up @@ -2055,7 +2059,7 @@ export function createIngestionClient({
triggerDockerSourceDiscover(
{ sourceID }: TriggerDockerSourceDiscoverProps,
requestOptions?: RequestOptions,
): Promise<SourceWatchResponse> {
): Promise<WatchResponse> {
if (!sourceID) {
throw new Error('Parameter `sourceID` is required when calling `triggerDockerSourceDiscover`.');
}
Expand Down Expand Up @@ -2410,7 +2414,7 @@ export function createIngestionClient({
validateSource(
sourceCreate: SourceCreate,
requestOptions: RequestOptions | undefined = undefined,
): Promise<SourceWatchResponse> {
): Promise<WatchResponse> {
const requestPath = '/1/sources/validate';
const headers: Headers = {};
const queryParameters: QueryParameters = {};
Expand Down Expand Up @@ -2441,7 +2445,7 @@ export function createIngestionClient({
validateSourceBeforeUpdate(
{ sourceID, sourceUpdate }: ValidateSourceBeforeUpdateProps,
requestOptions?: RequestOptions,
): Promise<SourceWatchResponse> {
): Promise<WatchResponse> {
if (!sourceID) {
throw new Error('Parameter `sourceID` is required when calling `validateSourceBeforeUpdate`.');
}
Expand Down

0 comments on commit 47b97d9

Please sign in to comment.