From ed5c7d659751cd2da089e9df22fc7dbeb76073a3 Mon Sep 17 00:00:00 2001 From: Raminder Singh Date: Thu, 24 Oct 2024 14:16:08 +0530 Subject: [PATCH] add source and sink names --- apps/studio/data/replication/create-sink-mutation.ts | 10 ++++++++-- packages/api-types/types/api.d.ts | 4 ++++ 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/apps/studio/data/replication/create-sink-mutation.ts b/apps/studio/data/replication/create-sink-mutation.ts index efa3dd6ee60..2687e222b1c 100644 --- a/apps/studio/data/replication/create-sink-mutation.ts +++ b/apps/studio/data/replication/create-sink-mutation.ts @@ -7,20 +7,26 @@ import { handleError, post } from 'data/fetchers' export type CreateSinkParams = { projectRef: string + sink_name: string project_id: string dataset_id: string service_account_key: string } async function createSink( - { projectRef, project_id, dataset_id, service_account_key }: CreateSinkParams, + { projectRef, sink_name, project_id, dataset_id, service_account_key }: CreateSinkParams, signal?: AbortSignal ) { if (!projectRef) throw new Error('projectRef is required') const { data, error } = await post('/platform/replication/{ref}/sinks', { params: { path: { ref: projectRef } }, - body: { project_id, dataset_id, service_account_key }, + body: { + project_id, + dataset_id, + service_account_key, + sink_name, + }, signal, }) if (error) { diff --git a/packages/api-types/types/api.d.ts b/packages/api-types/types/api.d.ts index 2c8c53b9df8..ea68ea0e5f1 100644 --- a/packages/api-types/types/api.d.ts +++ b/packages/api-types/types/api.d.ts @@ -8703,6 +8703,8 @@ export interface components { project_id: string /** @description BigQuery service account key */ service_account_key: string + /** @description Sink name */ + sink_name: string } CreateRoleBody: { admins?: string[] @@ -10879,6 +10881,7 @@ export interface components { BigQuery?: components['schemas']['ReplicationBigQueryConfig'] } id: number + name: string tenant_id: string } ReplicationSourcesResponse: { @@ -10886,6 +10889,7 @@ export interface components { Postgres?: components['schemas']['ReplicationPostgresConfig'] } id: number + name: string tenant_id: string } ReplicationTable: {