Skip to content

The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.

chore: rename sink to destination for the etl api (#35931)

Raminder Singhb411ed3421d0
diff --git a/apps/studio/components/interfaces/Database/Replication/DestinationPanel.tsx b/apps/studio/components/interfaces/Database/Replication/DestinationPanel.tsx
index 65a05da9ffa..9c2b10f5d39 100644
--- a/apps/studio/components/interfaces/Database/Replication/DestinationPanel.tsx
+++ b/apps/studio/components/interfaces/Database/Replication/DestinationPanel.tsx
@@ -39,12 +39,12 @@ import * as z from 'zod'
import PublicationsComboBox from './PublicationsComboBox'
import NewPublicationPanel from './NewPublicationPanel'
import { useState, useMemo, useEffect } from 'react'
-import { useReplicationSinkByIdQuery } from 'data/replication/sink-by-id-query'
+import { useReplicationDestinationByIdQuery } from 'data/replication/destination-by-id-query'
import { useReplicationPipelineByIdQuery } from 'data/replication/pipeline-by-id-query'
import { useStopPipelineMutation } from 'data/replication/stop-pipeline-mutation'
import { FormItemLayout } from 'ui-patterns/form/FormItemLayout/FormItemLayout'
-import { useCreateSinkPipelineMutation } from 'data/replication/create-sink-pipeline-mutation'
-import { useUpdateSinkPipelineMutation } from 'data/replication/update-sink-pipeline-mutation'
+import { useCreateDestinationPipelineMutation } from 'data/replication/create-destination-pipeline-mutation'
+import { useUpdateDestinationPipelineMutation } from 'data/replication/update-destination-pipeline-mutation'
interface DestinationPanelProps {
visible: boolean
@@ -52,7 +52,7 @@ interface DestinationPanelProps {
onClose: () => void
existingDestination?: {
sourceId?: number
- sinkId: number
+ destinationId: number
pipelineId?: number
enabled: boolean
}
@@ -68,20 +68,20 @@ const DestinationPanel = ({
const [publicationPanelVisible, setPublicationPanelVisible] = useState(false)
const { mutateAsync: createTenantSource, isLoading: creatingTenantSource } =
useCreateTenantSourceMutation()
- const { mutateAsync: createSinkPipeline, isLoading: creatingSinkPipeline } =
- useCreateSinkPipelineMutation()
+ const { mutateAsync: createDestinationPipeline, isLoading: creatingDestinationPipeline } =
+ useCreateDestinationPipelineMutation()
const { mutateAsync: startPipeline, isLoading: startingPipeline } = useStartPipelineMutation()
const { mutateAsync: stopPipeline, isLoading: stoppingPipeline } = useStopPipelineMutation()
- const { mutateAsync: updateSinkPipeline, isLoading: updatingSinkPipeline } =
- useUpdateSinkPipelineMutation()
+ const { mutateAsync: updateDestinationPipeline, isLoading: updatingDestinationPipeline } =
+ useUpdateDestinationPipelineMutation()
const { data: publications, isLoading: loadingPublications } = useReplicationPublicationsQuery({
projectRef,
sourceId,
})
- const { data: sinkData } = useReplicationSinkByIdQuery({
+ const { data: destinationData } = useReplicationDestinationByIdQuery({
projectRef,
- sinkId: existingDestination?.sinkId,
+ destinationId: existingDestination?.destinationId,
})
const { data: pipelineData } = useReplicationPipelineByIdQuery({
@@ -89,8 +89,8 @@ const DestinationPanel = ({
pipelineId: existingDestination?.pipelineId,
})
- const isCreating = creatingTenantSource || creatingSinkPipeline || startingPipeline
- const isUpdating = updatingSinkPipeline || stoppingPipeline || startingPipeline
+ const isCreating = creatingTenantSource || creatingDestinationPipeline || startingPipeline
+ const isUpdating = updatingDestinationPipeline || stoppingPipeline || startingPipeline
const isSubmitting = isCreating || isUpdating
const editMode = !!existingDestination
@@ -112,17 +112,17 @@ const DestinationPanel = ({
const defaultValues = useMemo(
() => ({
type: TypeEnum.enum.BigQuery,
- name: sinkData?.name ?? '',
- projectId: sinkData?.config?.big_query?.project_id ?? '',
- datasetId: sinkData?.config?.big_query?.dataset_id ?? '',
- serviceAccountKey: sinkData?.config?.big_query?.service_account_key ?? '',
+ name: destinationData?.name ?? '',
+ projectId: destinationData?.config?.big_query?.project_id ?? '',
+ datasetId: destinationData?.config?.big_query?.dataset_id ?? '',
+ serviceAccountKey: destinationData?.config?.big_query?.service_account_key ?? '',
publicationName: pipelineData?.publication_name ?? '',
maxSize: pipelineData?.config?.config?.max_size ?? 1000,
maxFillSecs: pipelineData?.config?.config?.max_fill_secs ?? 10,
- maxStalenessMins: sinkData?.config?.big_query?.max_staleness_mins ?? 5,
+ maxStalenessMins: destinationData?.config?.big_query?.max_staleness_mins ?? 5,
enabled: existingDestination?.enabled ?? true,
}),
- [sinkData, pipelineData, existingDestination]
+ [destinationData, pipelineData, existingDestination]
)
const form = useForm<z.infer<typeof FormSchema>>({
mode: 'onBlur',
@@ -143,12 +143,12 @@ const DestinationPanel = ({
return
}
// Update existing destination
- await updateSinkPipeline({
- sinkId: existingDestination.sinkId,
+ await updateDestinationPipeline({
+ destinationId: existingDestination.destinationId,
pipelineId: existingDestination.pipelineId,
projectRef,
- sinkName: data.name,
- sinkConfig: {
+ destinationName: data.name,
+ destinationConfig: {
bigQuery: {
projectId: data.projectId,
datasetId: data.datasetId,
@@ -175,10 +175,10 @@ const DestinationPanel = ({
console.error('Source id is required')
return
}
- const { pipeline_id: pipelineId } = await createSinkPipeline({
+ const { pipeline_id: pipelineId } = await createDestinationPipeline({
projectRef,
- sinkName: data.name,
- sinkConfig: {
+ destinationName: data.name,
+ destinationConfig: {
bigQuery: {
projectId: data.projectId,
datasetId: data.datasetId,
@@ -210,10 +210,10 @@ const DestinationPanel = ({
const { enabled } = form.watch()
useEffect(() => {
- if (editMode && sinkData && pipelineData) {
+ if (editMode && destinationData && pipelineData) {
form.reset(defaultValues)
}
- }, [sinkData, pipelineData, editMode, defaultValues, form])
+ }, [destinationData, pipelineData, editMode, defaultValues, form])
return (
<>
diff --git a/apps/studio/components/interfaces/Database/Replication/DestinationRow.tsx b/apps/studio/components/interfaces/Database/Replication/DestinationRow.tsx
index 01dc862519e..a213036979b 100644
--- a/apps/studio/components/interfaces/Database/Replication/DestinationRow.tsx
+++ b/apps/studio/components/interfaces/Database/Replication/DestinationRow.tsx
@@ -11,7 +11,7 @@ import { useState } from 'react'
import { toast } from 'sonner'
import { useStartPipelineMutation } from 'data/replication/start-pipeline-mutation'
import { useStopPipelineMutation } from 'data/replication/stop-pipeline-mutation'
-import { useDeleteSinkMutation } from 'data/replication/delete-sink-mutation'
+import { useDeleteDestinationMutation } from 'data/replication/delete-destination-mutation'
import DeleteDestination from './DeleteDestination'
import DestinationPanel from './DestinationPanel'
@@ -19,8 +19,8 @@ export type Pipeline = ReplicationPipelinesData['pipelines'][0]
interface DestinationRowProps {
sourceId: number | undefined
- sinkId: number
- sinkName: string
+ destinationId: number
+ destinationName: string
type: string
pipeline: Pipeline | undefined
error: ResponseError | null
@@ -31,8 +31,8 @@ interface DestinationRowProps {
const DestinationRow = ({
sourceId,
- sinkId,
- sinkName,
+ destinationId,
+ destinationName,
type,
pipeline,
error: pipelineError,
@@ -108,7 +108,7 @@ const DestinationRow = ({
setRequestStatus('DisableRequested')
setRefetchInterval(5000)
}
- const { mutateAsync: deleteSink } = useDeleteSinkMutation({})
+ const { mutateAsync: deleteDestination } = useDeleteDestinationMutation({})
const onDeleteClick = async () => {
if (!projectRef) {
@@ -122,9 +122,9 @@ const DestinationRow = ({
try {
await stopPipeline({ projectRef, pipelineId: pipeline.id })
- // deleting the sink also deletes the pipeline because of cascade delete
+ // deleting the destination also deletes the pipeline because of cascade delete
// so we don't need to call deletePipeline explicitly
- await deleteSink({ projectRef, sinkId })
+ await deleteDestination({ projectRef, destinationId: destinationId })
} catch (error) {
toast.error('Failed to delete destination')
}
@@ -138,7 +138,7 @@ const DestinationRow = ({
{isPipelineSuccess && (
<Table.tr>
<Table.td>
- {isPipelineLoading ? <ShimmeringLoader></ShimmeringLoader> : sinkName}
+ {isPipelineLoading ? <ShimmeringLoader></ShimmeringLoader> : destinationName}
</Table.td>
<Table.td>{isPipelineLoading ? <ShimmeringLoader></ShimmeringLoader> : type}</Table.td>
<Table.td>
@@ -181,7 +181,7 @@ const DestinationRow = ({
setVisible={setShowDeleteDestinationForm}
onDelete={onDeleteClick}
isLoading={isPipelineStatusLoading}
- name={sinkName}
+ name={destinationName}
/>
<DestinationPanel
visible={showEditDestinationPanel}
@@ -189,7 +189,7 @@ const DestinationRow = ({
sourceId={sourceId}
existingDestination={{
sourceId,
- sinkId,
+ destinationId: destinationId,
pipelineId: pipeline?.id,
enabled: pipelineStatusData?.status === 'Started',
}}
diff --git a/apps/studio/components/interfaces/Database/Replication/Destinations.tsx b/apps/studio/components/interfaces/Database/Replication/Destinations.tsx
index 573a1ab9dd9..d1bbfc71b5d 100644
--- a/apps/studio/components/interfaces/Database/Replication/Destinations.tsx
+++ b/apps/studio/components/interfaces/Database/Replication/Destinations.tsx
@@ -1,7 +1,7 @@
import { useParams } from 'common'
import Table from 'components/to-be-cleaned/Table'
import AlertError from 'components/ui/AlertError'
-import { useReplicationSinksQuery } from 'data/replication/sinks-query'
+import { useReplicationDestinationsQuery } from 'data/replication/destinations-query'
import { Plus } from 'lucide-react'
import { Button, cn } from 'ui'
import { GenericSkeletonLoader } from 'ui-patterns'
@@ -29,12 +29,12 @@ const Destinations = () => {
let sourceId = sourcesData?.sources.find((s) => s.name === projectRef)?.id
const {
- data: sinksData,
- error: sinksError,
- isLoading: isSinksLoading,
- isError: isSinksError,
- isSuccess: isSinksSuccess,
- } = useReplicationSinksQuery({
+ data: destinationsData,
+ error: destinationsError,
+ isLoading: isDestinationsLoading,
+ isError: isDestinationsError,
+ isSuccess: isDestinationsSuccess,
+ } = useReplicationDestinationsQuery({
projectRef,
})
@@ -48,7 +48,7 @@ const Destinations = () => {
projectRef,
})
- const anySinks = isSinksSuccess && sinksData.sinks.length > 0
+ const anyDestinations = isDestinationsSuccess && destinationsData.destinations.length > 0
return (
<>
@@ -59,16 +59,16 @@ const Destinations = () => {
Add destination
</Button>
</div>
- {(isSourcesLoading || isSinksLoading) && <GenericSkeletonLoader />}
+ {(isSourcesLoading || isDestinationsLoading) && <GenericSkeletonLoader />}
- {(isSourcesError || isSinksError) && (
+ {(isSourcesError || isDestinationsError) && (
<AlertError
- error={sourcesError || sinksError}
+ error={sourcesError || destinationsError}
subject="Failed to retrieve destinations"
/>
)}
- {anySinks ? (
+ {anyDestinations ? (
<Table
head={[
<Table.th key="name">Name</Table.th>,
@@ -77,15 +77,17 @@ const Destinations = () => {
<Table.th key="publication">Publication</Table.th>,
<Table.th key="actions"></Table.th>,
]}
- body={sinksData.sinks.map((sink) => {
- const pipeline = pipelinesData?.pipelines.find((p) => p.sink_id === sink.id)
+ body={destinationsData.destinations.map((destination) => {
+ const pipeline = pipelinesData?.pipelines.find(
+ (p) => p.destination_id === destination.id
+ )
return (
<DestinationRow
- key={sink.id}
+ key={destination.id}
sourceId={sourceId}
- sinkId={sink.id}
- sinkName={sink.name}
- type={sink.config.big_query ? 'BigQuery' : 'Other'}
+ destinationId={destination.id}
+ destinationName={destination.name}
+ type={destination.config.big_query ? 'BigQuery' : 'Other'}
pipeline={pipeline}
error={pipelinesError}
isLoading={isPipelinesLoading}
@@ -97,9 +99,9 @@ const Destinations = () => {
></Table>
) : (
!isSourcesLoading &&
- !isSinksLoading &&
+ !isDestinationsLoading &&
!isSourcesError &&
- !isSinksError && (
+ !isDestinationsError && (
<div
className={cn(
'w-full',
diff --git a/apps/studio/data/replication/create-sink-pipeline-mutation.ts b/apps/studio/data/replication/create-destination-pipeline-mutation.ts
similarity index 66%
rename from apps/studio/data/replication/create-sink-pipeline-mutation.ts
rename to apps/studio/data/replication/create-destination-pipeline-mutation.ts
index 92e00079d91..437f0435d12 100644
--- a/apps/studio/data/replication/create-sink-pipeline-mutation.ts
+++ b/apps/studio/data/replication/create-destination-pipeline-mutation.ts
@@ -5,29 +5,29 @@ import type { ResponseError } from 'types'
import { replicationKeys } from './keys'
import { handleError, post } from 'data/fetchers'
-export type BigQuerySinkConfig = {
+export type BigQueryDestinationConfig = {
projectId: string
datasetId: string
serviceAccountKey: string
maxStalenessMins: number
}
-export type CreateSinkPipelineParams = {
+export type CreateDestinationPipelineParams = {
projectRef: string
- sinkName: string
- sinkConfig: {
- bigQuery: BigQuerySinkConfig
+ destinationName: string
+ destinationConfig: {
+ bigQuery: BigQueryDestinationConfig
}
sourceId: number
publicationName: string
pipelinConfig: { config: { maxSize: number; maxFillSecs: number } }
}
-async function createSinkPipeline(
+async function createDestinationPipeline(
{
projectRef,
- sinkName,
- sinkConfig: {
+ destinationName: destinationName,
+ destinationConfig: {
bigQuery: { projectId, datasetId, serviceAccountKey, maxStalenessMins },
},
pipelinConfig: {
@@ -35,16 +35,16 @@ async function createSinkPipeline(
},
publicationName,
sourceId,
- }: CreateSinkPipelineParams,
+ }: CreateDestinationPipelineParams,
signal?: AbortSignal
) {
if (!projectRef) throw new Error('projectRef is required')
- const { data, error } = await post('/platform/replication/{ref}/sinks-pipelines', {
+ const { data, error } = await post('/platform/replication/{ref}/destinations-pipelines', {
params: { path: { ref: projectRef } },
body: {
- sink_name: sinkName,
- sink_config: {
+ destination_name: destinationName,
+ destination_config: {
big_query: {
project_id: projectId,
dataset_id: datasetId,
@@ -70,30 +70,30 @@ async function createSinkPipeline(
return data
}
-type CreateSinkPipelineData = Awaited<ReturnType<typeof createSinkPipeline>>
+type CreateDestinationPipelineData = Awaited<ReturnType<typeof createDestinationPipeline>>
-export const useCreateSinkPipelineMutation = ({
+export const useCreateDestinationPipelineMutation = ({
onSuccess,
onError,
...options
}: Omit<
- UseMutationOptions<CreateSinkPipelineData, ResponseError, CreateSinkPipelineParams>,
+ UseMutationOptions<CreateDestinationPipelineData, ResponseError, CreateDestinationPipelineParams>,
'mutationFn'
> = {}) => {
const queryClient = useQueryClient()
- return useMutation<CreateSinkPipelineData, ResponseError, CreateSinkPipelineParams>(
- (vars) => createSinkPipeline(vars),
+ return useMutation<CreateDestinationPipelineData, ResponseError, CreateDestinationPipelineParams>(
+ (vars) => createDestinationPipeline(vars),
{
async onSuccess(data, variables, context) {
const { projectRef } = variables
- await queryClient.invalidateQueries(replicationKeys.sinks(projectRef))
+ await queryClient.invalidateQueries(replicationKeys.destinations(projectRef))
await queryClient.invalidateQueries(replicationKeys.pipelines(projectRef))
await onSuccess?.(data, variables, context)
},
async onError(data, variables, context) {
if (onError === undefined) {
- toast.error(`Failed to create sink or pipeline: ${data.message}`)
+ toast.error(`Failed to create destination or pipeline: ${data.message}`)
} else {
onError(data, variables, context)
}
diff --git a/apps/studio/data/replication/delete-destination-mutation.ts b/apps/studio/data/replication/delete-destination-mutation.ts
new file mode 100644
index 00000000000..ce17893e5c4
--- /dev/null
+++ b/apps/studio/data/replication/delete-destination-mutation.ts
@@ -0,0 +1,60 @@
+import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react-query'
+import { toast } from 'sonner'
+
+import type { ResponseError } from 'types'
+import { replicationKeys } from './keys'
+import { handleError, del } from 'data/fetchers'
+
+export type DeleteDestinationParams = {
+ projectRef: string
+ destinationId: number
+}
+
+async function deleteDestination(
+ { projectRef, destinationId: destinationId }: DeleteDestinationParams,
+ signal?: AbortSignal
+) {
+ if (!projectRef) throw new Error('projectRef is required')
+
+ const { data, error } = await del('/platform/replication/{ref}/destinations/{destination_id}', {
+ params: { path: { ref: projectRef, destination_id: destinationId } },
+ signal,
+ })
+ if (error) {
+ handleError(error)
+ }
+
+ return data
+}
+
+type DeleteDestinationData = Awaited<ReturnType<typeof deleteDestination>>
+
+export const useDeleteDestinationMutation = ({
+ onSuccess,
+ onError,
+ ...options
+}: Omit<
+ UseMutationOptions<DeleteDestinationData, ResponseError, DeleteDestinationParams>,
+ 'mutationFn'
+> = {}) => {
+ const queryClient = useQueryClient()
+
+ return useMutation<DeleteDestinationData, ResponseError, DeleteDestinationParams>(
+ (vars) => deleteDestination(vars),
+ {
+ async onSuccess(data, variables, context) {
+ const { projectRef, destinationId } = variables
+ await queryClient.invalidateQueries(replicationKeys.destinations(projectRef))
+ await onSuccess?.(data, variables, context)
+ },
+ async onError(data, variables, context) {
+ if (onError === undefined) {
+ toast.error(`Failed to delete destination: ${data.message}`)
+ } else {
+ onError(data, variables, context)
+ }
+ },
+ ...options,
+ }
+ )
+}
diff --git a/apps/studio/data/replication/delete-sink-mutation.ts b/apps/studio/data/replication/delete-sink-mutation.ts
deleted file mode 100644
index 101d56255dd..00000000000
--- a/apps/studio/data/replication/delete-sink-mutation.ts
+++ /dev/null
@@ -1,54 +0,0 @@
-import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react-query'
-import { toast } from 'sonner'
-
-import type { ResponseError } from 'types'
-import { replicationKeys } from './keys'
-import { handleError, del } from 'data/fetchers'
-
-export type DeleteSinkParams = {
- projectRef: string
- sinkId: number
-}
-
-async function deleteSink({ projectRef, sinkId }: DeleteSinkParams, signal?: AbortSignal) {
- if (!projectRef) throw new Error('projectRef is required')
-
- const { data, error } = await del('/platform/replication/{ref}/sinks/{sink_id}', {
- params: { path: { ref: projectRef, sink_id: sinkId } },
- signal,
- })
- if (error) {
- handleError(error)
- }
-
- return data
-}
-
-type DeleteSinkData = Awaited<ReturnType<typeof deleteSink>>
-
-export const useDeleteSinkMutation = ({
- onSuccess,
- onError,
- ...options
-}: Omit<
- UseMutationOptions<DeleteSinkData, ResponseError, DeleteSinkParams>,
- 'mutationFn'
-> = {}) => {
- const queryClient = useQueryClient()
-
- return useMutation<DeleteSinkData, ResponseError, DeleteSinkParams>((vars) => deleteSink(vars), {
- async onSuccess(data, variables, context) {
- const { projectRef, sinkId } = variables
- await queryClient.invalidateQueries(replicationKeys.sinks(projectRef))
- await onSuccess?.(data, variables, context)
- },
- async onError(data, variables, context) {
- if (onError === undefined) {
- toast.error(`Failed to delete sink: ${data.message}`)
- } else {
- onError(data, variables, context)
- }
- },
- ...options,
- })
-}
diff --git a/apps/studio/data/replication/destination-by-id-query.ts b/apps/studio/data/replication/destination-by-id-query.ts
new file mode 100644
index 00000000000..9d7559bf831
--- /dev/null
+++ b/apps/studio/data/replication/destination-by-id-query.ts
@@ -0,0 +1,44 @@
+import { UseQueryOptions, useQuery } from '@tanstack/react-query'
+
+import { get, handleError } from 'data/fetchers'
+import { ResponseError } from 'types'
+import { replicationKeys } from './keys'
+
+type ReplicationDestinationByIdParams = { projectRef?: string; destinationId?: number }
+
+async function fetchReplicationDestinationById(
+ { projectRef, destinationId }: ReplicationDestinationByIdParams,
+ signal?: AbortSignal
+) {
+ if (!projectRef) throw new Error('projectRef is required')
+ if (!destinationId) throw new Error('destinationId is required')
+ const { data, error } = await get('/platform/replication/{ref}/destinations/{destination_id}', {
+ params: { path: { ref: projectRef, destination_id: destinationId } },
+ signal,
+ })
+ if (error) {
+ handleError(error)
+ }
+
+ return data
+}
+
+export type ReplicationDestinationByIdData = Awaited<
+ ReturnType<typeof fetchReplicationDestinationById>
+>
+
+export const useReplicationDestinationByIdQuery = <TData = ReplicationDestinationByIdData>(
+ { projectRef, destinationId }: ReplicationDestinationByIdParams,
+ {
+ enabled = true,
+ ...options
+ }: UseQueryOptions<ReplicationDestinationByIdData, ResponseError, TData> = {}
+) =>
+ useQuery<ReplicationDestinationByIdData, ResponseError, TData>(
+ replicationKeys.destinationById(projectRef, destinationId),
+ ({ signal }) => fetchReplicationDestinationById({ projectRef, destinationId }, signal),
+ {
+ enabled: enabled && typeof projectRef !== 'undefined' && typeof destinationId !== 'undefined',
+ ...options,
+ }
+ )
diff --git a/apps/studio/data/replication/destinations-query.ts b/apps/studio/data/replication/destinations-query.ts
new file mode 100644
index 00000000000..85449c6be92
--- /dev/null
+++ b/apps/studio/data/replication/destinations-query.ts
@@ -0,0 +1,39 @@
+import { UseQueryOptions, useQuery } from '@tanstack/react-query'
+
+import { get, handleError } from 'data/fetchers'
+import { ResponseError } from 'types'
+import { replicationKeys } from './keys'
+
+type ReplicationDestinationsParams = { projectRef?: string }
+
+async function fetchReplicationDestinations(
+ { projectRef }: ReplicationDestinationsParams,
+ signal?: AbortSignal
+) {
+ if (!projectRef) throw new Error('projectRef is required')
+
+ const { data, error } = await get('/platform/replication/{ref}/destinations', {
+ params: { path: { ref: projectRef } },
+ signal,
+ })
+ if (error) {
+ handleError(error)
+ }
+
+ return data
+}
+
+export type ReplicationDestinationsData = Awaited<ReturnType<typeof fetchReplicationDestinations>>
+
+export const useReplicationDestinationsQuery = <TData = ReplicationDestinationsData>(
+ { projectRef }: ReplicationDestinationsParams,
+ {
+ enabled = true,
+ ...options
+ }: UseQueryOptions<ReplicationDestinationsData, ResponseError, TData> = {}
+) =>
+ useQuery<ReplicationDestinationsData, ResponseError, TData>(
+ replicationKeys.destinations(projectRef),
+ ({ signal }) => fetchReplicationDestinations({ projectRef }, signal),
+ { enabled: enabled && typeof projectRef !== 'undefined', ...options }
+ )
diff --git a/apps/studio/data/replication/keys.ts b/apps/studio/data/replication/keys.ts
index 1dcdd61c0f6..ce20ee79d4a 100644
--- a/apps/studio/data/replication/keys.ts
+++ b/apps/studio/data/replication/keys.ts
@@ -1,8 +1,9 @@
export const replicationKeys = {
sources: (projectRef: string | undefined) => ['projects', projectRef, 'sources'] as const,
- sinks: (projectRef: string | undefined) => ['projects', projectRef, 'sinks'] as const,
- sinkById: (projectRef: string | undefined, sinkId: number | undefined) =>
- ['projects', projectRef, 'sinks', sinkId] as const,
+ destinations: (projectRef: string | undefined) =>
+ ['projects', projectRef, 'destinations'] as const,
+ destinationById: (projectRef: string | undefined, destinationId: number | undefined) =>
+ ['projects', projectRef, 'destinations', destinationId] as const,
publications: (projectRef: string | undefined, source_id: number | undefined) =>
['projects', projectRef, 'sources', source_id, 'publications'] as const,
tables: (projectRef: string | undefined, source_id: number | undefined) =>
diff --git a/apps/studio/data/replication/sink-by-id-query.ts b/apps/studio/data/replication/sink-by-id-query.ts
deleted file mode 100644
index 6ad00e2d831..00000000000
--- a/apps/studio/data/replication/sink-by-id-query.ts
+++ /dev/null
@@ -1,42 +0,0 @@
-import { UseQueryOptions, useQuery } from '@tanstack/react-query'
-
-import { get, handleError } from 'data/fetchers'
-import { ResponseError } from 'types'
-import { replicationKeys } from './keys'
-
-type ReplicationSinkByIdParams = { projectRef?: string; sinkId?: number }
-
-async function fetchReplicationSinkById(
- { projectRef, sinkId }: ReplicationSinkByIdParams,
- signal?: AbortSignal
-) {
- if (!projectRef) throw new Error('projectRef is required')
- if (!sinkId) throw new Error('sinkId is required')
- const { data, error } = await get('/platform/replication/{ref}/sinks/{sink_id}', {
- params: { path: { ref: projectRef, sink_id: sinkId } },
- signal,
- })
- if (error) {
- handleError(error)
- }
-
- return data
-}
-
-export type ReplicationSinkByIdData = Awaited<ReturnType<typeof fetchReplicationSinkById>>
-
-export const useReplicationSinkByIdQuery = <TData = ReplicationSinkByIdData>(
- { projectRef, sinkId }: ReplicationSinkByIdParams,
- {
- enabled = true,
- ...options
- }: UseQueryOptions<ReplicationSinkByIdData, ResponseError, TData> = {}
-) =>
- useQuery<ReplicationSinkByIdData, ResponseError, TData>(
- replicationKeys.sinkById(projectRef, sinkId),
- ({ signal }) => fetchReplicationSinkById({ projectRef, sinkId }, signal),
- {
- enabled: enabled && typeof projectRef !== 'undefined' && typeof sinkId !== 'undefined',
- ...options,
- }
- )
diff --git a/apps/studio/data/replication/sinks-query.ts b/apps/studio/data/replication/sinks-query.ts
deleted file mode 100644
index de08ebb4f1f..00000000000
--- a/apps/studio/data/replication/sinks-query.ts
+++ /dev/null
@@ -1,33 +0,0 @@
-import { UseQueryOptions, useQuery } from '@tanstack/react-query'
-
-import { get, handleError } from 'data/fetchers'
-import { ResponseError } from 'types'
-import { replicationKeys } from './keys'
-
-type ReplicationSinksParams = { projectRef?: string }
-
-async function fetchReplicationSinks({ projectRef }: ReplicationSinksParams, signal?: AbortSignal) {
- if (!projectRef) throw new Error('projectRef is required')
-
- const { data, error } = await get('/platform/replication/{ref}/sinks', {
- params: { path: { ref: projectRef } },
- signal,
- })
- if (error) {
- handleError(error)
- }
-
- return data
-}
-
-export type ReplicationSinksData = Awaited<ReturnType<typeof fetchReplicationSinks>>
-
-export const useReplicationSinksQuery = <TData = ReplicationSinksData>(
- { projectRef }: ReplicationSinksParams,
- { enabled = true, ...options }: UseQueryOptions<ReplicationSinksData, ResponseError, TData> = {}
-) =>
- useQuery<ReplicationSinksData, ResponseError, TData>(
- replicationKeys.sinks(projectRef),
- ({ signal }) => fetchReplicationSinks({ projectRef }, signal),
- { enabled: enabled && typeof projectRef !== 'undefined', ...options }
- )
diff --git a/apps/studio/data/replication/update-sink-pipeline-mutation.ts b/apps/studio/data/replication/update-destination-pipeline-mutation.ts
similarity index 61%
rename from apps/studio/data/replication/update-sink-pipeline-mutation.ts
rename to apps/studio/data/replication/update-destination-pipeline-mutation.ts
index 6abe772ce3d..f9c030d21fe 100644
--- a/apps/studio/data/replication/update-sink-pipeline-mutation.ts
+++ b/apps/studio/data/replication/update-destination-pipeline-mutation.ts
@@ -5,33 +5,33 @@ import type { ResponseError } from 'types'
import { replicationKeys } from './keys'
import { handleError, post } from 'data/fetchers'
-export type BigQuerySinkConfig = {
+export type BigQueryDestinationConfig = {
projectId: string
datasetId: string
serviceAccountKey: string
maxStalenessMins: number
}
-export type UpdateSinkPipelineParams = {
- sinkId: number
+export type UpdateDestinationPipelineParams = {
+ destinationId: number
pipelineId: number
projectRef: string
- sinkName: string
- sinkConfig: {
- bigQuery: BigQuerySinkConfig
+ destinationName: string
+ destinationConfig: {
+ bigQuery: BigQueryDestinationConfig
}
sourceId: number
publicationName: string
pipelinConfig: { config: { maxSize: number; maxFillSecs: number } }
}
-async function updateSinkPipeline(
+async function updateDestinationPipeline(
{
- sinkId,
+ destinationId: destinationId,
pipelineId,
projectRef,
- sinkName,
- sinkConfig: {
+ destinationName: destinationName,
+ destinationConfig: {
bigQuery: { projectId, datasetId, serviceAccountKey, maxStalenessMins },
},
pipelinConfig: {
@@ -39,18 +39,18 @@ async function updateSinkPipeline(
},
publicationName,
sourceId,
- }: UpdateSinkPipelineParams,
+ }: UpdateDestinationPipelineParams,
signal?: AbortSignal
) {
if (!projectRef) throw new Error('projectRef is required')
const { data, error } = await post(
- '/platform/replication/{ref}/sinks-pipelines/{sink_id}/{pipeline_id}',
+ '/platform/replication/{ref}/destinations-pipelines/{destination_id}/{pipeline_id}',
{
- params: { path: { ref: projectRef, sink_id: sinkId, pipeline_id: pipelineId } },
+ params: { path: { ref: projectRef, destination_id: destinationId, pipeline_id: pipelineId } },
body: {
- sink_name: sinkName,
- sink_config: {
+ destination_name: destinationName,
+ destination_config: {
big_query: {
project_id: projectId,
dataset_id: datasetId,
@@ -77,30 +77,30 @@ async function updateSinkPipeline(
return data
}
-type UpdateSinkPipelineData = Awaited<ReturnType<typeof updateSinkPipeline>>
+type UpdateDestinationPipelineData = Awaited<ReturnType<typeof updateDestinationPipeline>>
-export const useUpdateSinkPipelineMutation = ({
+export const useUpdateDestinationPipelineMutation = ({
onSuccess,
onError,
...options
}: Omit<
- UseMutationOptions<UpdateSinkPipelineData, ResponseError, UpdateSinkPipelineParams>,
+ UseMutationOptions<UpdateDestinationPipelineData, ResponseError, UpdateDestinationPipelineParams>,
'mutationFn'
> = {}) => {
const queryClient = useQueryClient()
- return useMutation<UpdateSinkPipelineData, ResponseError, UpdateSinkPipelineParams>(
- (vars) => updateSinkPipeline(vars),
+ return useMutation<UpdateDestinationPipelineData, ResponseError, UpdateDestinationPipelineParams>(
+ (vars) => updateDestinationPipeline(vars),
{
async onSuccess(data, variables, context) {
const { projectRef } = variables
- await queryClient.invalidateQueries(replicationKeys.sinks(projectRef))
+ await queryClient.invalidateQueries(replicationKeys.destinations(projectRef))
await queryClient.invalidateQueries(replicationKeys.pipelines(projectRef))
await onSuccess?.(data, variables, context)
},
async onError(data, variables, context) {
if (onError === undefined) {
- toast.error(`Failed to update sink or pipeline: ${data.message}`)
+ toast.error(`Failed to update destination or pipeline: ${data.message}`)
} else {
onError(data, variables, context)
}
diff --git a/packages/api-types/types/platform.d.ts b/packages/api-types/types/platform.d.ts
index 2ff723549df..0c7d9ee9529 100644
--- a/packages/api-types/types/platform.d.ts
+++ b/packages/api-types/types/platform.d.ts
@@ -3175,44 +3175,42 @@ export interface paths {
patch?: never
trace?: never
}
- '/platform/replication/{ref}/pipelines': {
+ '/platform/replication/{ref}/destinations': {
parameters: {
query?: never
header?: never
path?: never
cookie?: never
}
- /** Gets replication pipelines */
- get: operations['ReplicationPipelinesController_getPipelines']
+ /** Gets replication destinations */
+ get: operations['ReplicationDestinationsController_getDestinations']
put?: never
- /** Creates a pipeline */
- post: operations['ReplicationPipelinesController_createPipeline']
+ /** Creates a destination */
+ post: operations['ReplicationDestinationsController_createDestination']
delete?: never
options?: never
head?: never
patch?: never
trace?: never
}
- '/platform/replication/{ref}/pipelines/{pipeline_id}': {
+ '/platform/replication/{ref}/destinations-pipelines': {
parameters: {
query?: never
header?: never
path?: never
cookie?: never
}
- /** Gets a pipeline by id */
- get: operations['ReplicationPipelinesController_getPipeline']
+ get?: never
put?: never
- /** Updates a pipeline */
- post: operations['ReplicationPipelinesController_updatePipeline']
- /** Deletes a pipeline */
- delete: operations['ReplicationPipelinesController_deletePipeline']
+ /** Creates a replication destination and pipeline. */
+ post: operations['ReplicationDestinationsPipelinesController_createDestinationPipeline']
+ delete?: never
options?: never
head?: never
patch?: never
trace?: never
}
- '/platform/replication/{ref}/pipelines/{pipeline_id}/start': {
+ '/platform/replication/{ref}/destinations-pipelines/{destination_id}/{pipeline_id}': {
parameters: {
query?: never
header?: never
@@ -3221,67 +3219,87 @@ export interface paths {
}
get?: never
put?: never
- /** Starts a pipeline */
- post: operations['ReplicationPipelinesController_startPipeline']
+ /** Updates a replication destination and pipeline */
+ post: operations['ReplicationDestinationsPipelinesController_updateDestinationPipeline']
delete?: never
options?: never
head?: never
patch?: never
trace?: never
}
- '/platform/replication/{ref}/pipelines/{pipeline_id}/status': {
+ '/platform/replication/{ref}/destinations/{destinaion_id}': {
parameters: {
query?: never
header?: never
path?: never
cookie?: never
}
- /** Gets status of a pipeline */
- get: operations['ReplicationPipelinesController_getPipelineStatus']
+ get?: never
put?: never
- post?: never
+ /** Updates a destination */
+ post: operations['ReplicationDestinationsController_updateDestination']
delete?: never
options?: never
head?: never
patch?: never
trace?: never
}
- '/platform/replication/{ref}/pipelines/{pipeline_id}/stop': {
+ '/platform/replication/{ref}/destinations/{destination_id}': {
parameters: {
query?: never
header?: never
path?: never
cookie?: never
}
- get?: never
+ /** Gets a destination by id */
+ get: operations['ReplicationDestinationsController_getDestination']
put?: never
- /** Stops a pipeline */
- post: operations['ReplicationPipelinesController_stopPipeline']
- delete?: never
+ post?: never
+ /** Deletes a destination */
+ delete: operations['ReplicationDestinationsController_deleteDestination']
options?: never
head?: never
patch?: never
trace?: never
}
- '/platform/replication/{ref}/sinks': {
+ '/platform/replication/{ref}/pipelines': {
parameters: {
query?: never
header?: never
path?: never
cookie?: never
}
- /** Gets replication sinks */
- get: operations['ReplicationSinksController_getSinks']
+ /** Gets replication pipelines */
+ get: operations['ReplicationPipelinesController_getPipelines']
put?: never
- /** Creates a sink */
- post: operations['ReplicationSinksController_createSink']
+ /** Creates a pipeline */
+ post: operations['ReplicationPipelinesController_createPipeline']
delete?: never
options?: never
head?: never
patch?: never
trace?: never
}
- '/platform/replication/{ref}/sinks-pipelines': {
+ '/platform/replication/{ref}/pipelines/{pipeline_id}': {
+ parameters: {
+ query?: never
+ header?: never
+ path?: never
+ cookie?: never
+ }
+ /** Gets a pipeline by id */
+ get: operations['ReplicationPipelinesController_getPipeline']
+ put?: never
+ /** Updates a pipeline */
+ post: operations['ReplicationPipelinesController_updatePipeline']
+ /** Deletes a pipeline */
+ delete: operations['ReplicationPipelinesController_deletePipeline']
+ options?: never
+ head?: never
+ patch?: never
+ trace?: never
+ }
+ '/platform/replication/{ref}/pipelines/{pipeline_id}/start': {
parameters: {
query?: never
header?: never
@@ -3290,45 +3308,43 @@ export interface paths {
}
get?: never
put?: never
- /** Creates a replication sink and pipeline. */
- post: operations['ReplicationSinksPipelinesController_createSinkPipeline']
+ /** Starts a pipeline */
+ post: operations['ReplicationPipelinesController_startPipeline']
delete?: never
options?: never
head?: never
patch?: never
trace?: never
}
- '/platform/replication/{ref}/sinks-pipelines/{sink_id}/{pipeline_id}': {
+ '/platform/replication/{ref}/pipelines/{pipeline_id}/status': {
parameters: {
query?: never
header?: never
path?: never
cookie?: never
}
- get?: never
+ /** Gets status of a pipeline */
+ get: operations['ReplicationPipelinesController_getPipelineStatus']
put?: never
- /** Updates a replication sink and pipeline */
- post: operations['ReplicationSinksPipelinesController_updateSinkPipeline']
+ post?: never
delete?: never
options?: never
head?: never
patch?: never
trace?: never
}
- '/platform/replication/{ref}/sinks/{sink_id}': {
+ '/platform/replication/{ref}/pipelines/{pipeline_id}/stop': {
parameters: {
query?: never
header?: never
path?: never
cookie?: never
}
- /** Gets a sink by id */
- get: operations['ReplicationSinksController_getSink']
+ get?: never
put?: never
- /** Updates a sink */
- post: operations['ReplicationSinksController_updateSink']
- /** Deletes a sink */
- delete: operations['ReplicationSinksController_deleteSink']
+ /** Stops a pipeline */
+ post: operations['ReplicationPipelinesController_stopPipeline']
+ delete?: never
options?: never
head?: never
patch?: never
@@ -4330,6 +4346,15 @@ export interface components {
/** Format: uuid */
parent_id?: string
}
+ CreateDestinationPipelineResponse: {
+ /** @description Destination id */
+ destination_id: number
+ /** @description Pipeline id */
+ pipeline_id: number
+ }
+ CreateDestinationResponse: {
+ id: number
+ }
CreateExtensionBody: {
cascade: boolean
name: string
@@ -4617,54 +4642,21 @@ export interface components {
publish_update?: boolean
tables?: string[] | null
}
- CreateReplicationPipelineBody: {
- /** @description Pipeline config */
- config: {
- config: {
- max_fill_secs: number
- max_size: number
- }
- }
- /** @description Publication name */
- publication_name: string
- /** @description Sink id */
- sink_id: number
- /** @description Source id */
- source_id: number
- }
- CreateReplicationPublicationBody: {
- /** @description Publication name */
- name: string
- /** @description Publication tables */
- tables: {
- name: string
- schema: string
- }[]
- }
- CreateReplicationSinkBody: {
+ CreateReplicationDestinationBody: {
/** @description BigQuery dataset id */
dataset_id: string
+ /** @description Destination name */
+ destination_name: string
/** @description Max staleness in minutes */
max_staleness_mins: number
/** @description BigQuery project id */
project_id: string
/** @description BigQuery service account key */
service_account_key: string
- /** @description Sink name */
- sink_name: string
}
- CreateReplicationSinkPipelineBody: {
- /** @description Pipeline config */
- pipeline_config: {
- config: {
- max_fill_secs: number
- max_size: number
- }
- }
- /** @description Publication name */
- publication_name: string
- /** @description Sink config */
- sink_config: {
+ CreateReplicationDestinationPipelineBody: {
+ /** @description Destination config */
+ destination_config: {
big_query: {
/** @description BigQuery dataset id */
dataset_id: string
@@ -4676,24 +4668,48 @@ export interface components {
service_account_key: string
}
}
- /** @description Sink name */
- sink_name: string
+ /** @description Destination name */
+ destination_name: string
+ /** @description Pipeline config */
+ pipeline_config: {
+ config: {
+ max_fill_secs: number
+ max_size: number
+ }
+ }
+ /** @description Publication name */
+ publication_name: string
+ /** @description Source id */
+ source_id: number
+ }
+ CreateReplicationPipelineBody: {
+ /** @description Pipeline config */
+ config: {
+ config: {
+ max_fill_secs: number
+ max_size: number
+ }
+ }
+ /** @description Destination id */
+ destination_id: number
+ /** @description Publication name */
+ publication_name: string
/** @description Source id */
source_id: number
}
+ CreateReplicationPublicationBody: {
+ /** @description Publication name */
+ name: string
+ /** @description Publication tables */
+ tables: {
+ name: string
+ schema: string
+ }[]
+ }
CreateSchemaBody: {
name: string
owner: string
}
- CreateSinkPipelineResponse: {
- /** @description Pipeline id */
- pipeline_id: number
- /** @description Sink id */
- sink_id: number
- }
- CreateSinkResponse: {
- id: number
- }
CreateSourceResponse: {
id: number
}
@@ -5639,7 +5655,6 @@ export interface components {
MAILER_TEMPLATES_MAGIC_LINK_CONTENT: string
MAILER_TEMPLATES_REAUTHENTICATION_CONTENT: string
MAILER_TEMPLATES_RECOVERY_CONTENT: string
- MFA_ALLOW_LOW_AAL: boolean
MFA_MAX_ENROLLED_FACTORS: number
MFA_PHONE_ENROLL_ENABLED: boolean
MFA_PHONE_MAX_FREQUENCY: number
@@ -6991,6 +7006,42 @@ export interface components {
/** @description Whether to only allow private channels */
private_only: boolean | null
}
+ ReplicationDestinationResponse: {
+ config: {
+ big_query: {
+ /** @description BigQuery dataset id */
+ dataset_id: string
+ /** @description Max staleness in minutes */
+ max_staleness_mins: number
+ /** @description BigQuery project id */
+ project_id: string
+ /** @description BigQuery service account key */
+ service_account_key: string
+ }
+ }
+ id: number
+ name: string
+ tenant_id: string
+ }
+ ReplicationDestinationsResponse: {
+ destinations: {
+ config: {
+ big_query: {
+ /** @description BigQuery dataset id */
+ dataset_id: string
+ /** @description Max staleness in minutes */
+ max_staleness_mins: number
+ /** @description BigQuery project id */
+ project_id: string
+ /** @description BigQuery service account key */
+ service_account_key: string
+ }
+ }
+ id: number
+ name: string
+ tenant_id: string
+ }[]
+ }
ReplicationPipelineResponse: {
config: {
config: {
@@ -6998,11 +7049,11 @@ export interface components {
max_size: number
}
}
+ destination_id: number
+ destination_name: string
id: number
publication_name: string
replicator_id: number
- sink_id: number
- sink_name: string
source_id: number
source_name: string
tenant_id: string
@@ -7015,11 +7066,11 @@ export interface components {
max_size: number
}
}
+ destination_id: number
+ destination_name: string
id: number
publication_name: string
replicator_id: number
- sink_id: number
- sink_name: string
source_id: number
source_name: string
tenant_id: string
@@ -7038,42 +7089,6 @@ export interface components {
}[]
}[]
}
- ReplicationSinkResponse: {
- config: {
- big_query: {
- /** @description BigQuery dataset id */
- dataset_id: string
- /** @description Max staleness in minutes */
- max_staleness_mins: number
- /** @description BigQuery project id */
- project_id: string
- /** @description BigQuery service account key */
- service_account_key: string
- }
- }
- id: number
- name: string
- tenant_id: string
- }
- ReplicationSinksResponse: {
- sinks: {
- config: {
- big_query: {
- /** @description BigQuery dataset id */
- dataset_id: string
- /** @description Max staleness in minutes */
- max_staleness_mins: number
- /** @description BigQuery project id */
- project_id: string
- /** @description BigQuery service account key */
- service_account_key: string
- }
- }
- id: number
- name: string
- tenant_id: string
- }[]
- }
ReplicationSourcesResponse: {
sources: {
config: {
@@ -7833,7 +7848,6 @@ export interface components {
MAILER_TEMPLATES_MAGIC_LINK_CONTENT?: string | null
MAILER_TEMPLATES_REAUTHENTICATION_CONTENT?: string | null
MAILER_TEMPLATES_RECOVERY_CONTENT?: string | null
- MFA_ALLOW_LOW_AAL?: boolean | null
MFA_MAX_ENROLLED_FACTORS?: number | null
MFA_PHONE_ENROLL_ENABLED?: boolean | null
MFA_PHONE_MAX_FREQUENCY?: number | null
@@ -8078,45 +8092,21 @@ export interface components {
/** @description Whether to only allow private channels */
private_only?: boolean
}
- UpdateReplicationPipelineBody: {
- /** @description Pipeline config */
- config?: {
- config: {
- max_fill_secs: number
- max_size: number
- }
- }
- /** @description Publication name */
- publication_name?: string
- /** @description Sink id */
- sink_id?: number
- /** @description Source id */
- source_id?: number
- }
- UpdateReplicationSinkBody: {
+ UpdateReplicationDestinationBody: {
/** @description BigQuery dataset id */
dataset_id: string
+ /** @description Destination name */
+ destination_name: string
/** @description Max staleness in minutes */
max_staleness_mins: number
/** @description BigQuery project id */
project_id: string
/** @description BigQuery service account key */
service_account_key: string
- /** @description Sink name */
- sink_name: string
}
- UpdateReplicationSinkPipelineBody: {
- /** @description Pipeline config */
- pipeline_config: {
- config: {
- max_fill_secs: number
- max_size: number
- }
- }
- /** @description Publication name */
- publication_name: string
- /** @description Sink config */
- sink_config: {
+ UpdateReplicationDestinationPipelineBody: {
+ /** @description Destination config */
+ destination_config: {
big_query: {
/** @description BigQuery dataset id */
dataset_id: string
@@ -8128,11 +8118,35 @@ export interface components {
service_account_key: string
}
}
- /** @description Sink name */
- sink_name: string
+ /** @description Destination name */
+ destination_name: string
+ /** @description Pipeline config */
+ pipeline_config: {
+ config: {
+ max_fill_secs: number
+ max_size: number
+ }
+ }
+ /** @description Publication name */
+ publication_name: string
/** @description Source id */
source_id: number
}
+ UpdateReplicationPipelineBody: {
+ /** @description Pipeline config */
+ config?: {
+ config: {
+ max_fill_secs: number
+ max_size: number
+ }
+ }
+ /** @description Destination id */
+ destination_id?: number
+ /** @description Publication name */
+ publication_name?: string
+ /** @description Source id */
+ source_id?: number
+ }
UpdateSchemaBody: {
name?: string
owner?: string
@@ -17320,7 +17334,7 @@ export interface operations {
}
}
}
- ReplicationPipelinesController_getPipelines: {
+ ReplicationDestinationsController_getDestinations: {
parameters: {
query?: never
header?: never
@@ -17337,7 +17351,7 @@ export interface operations {
[name: string]: unknown
}
content: {
- 'application/json': components['schemas']['ReplicationPipelinesResponse']
+ 'application/json': components['schemas']['ReplicationDestinationsResponse']
}
}
403: {
@@ -17346,7 +17360,7 @@ export interface operations {
}
content?: never
}
- /** @description Failed to get replication pipeline */
+ /** @description Failed to get replication destinations */
500: {
headers: {
[name: string]: unknown
@@ -17355,7 +17369,7 @@ export interface operations {
}
}
}
- ReplicationPipelinesController_createPipeline: {
+ ReplicationDestinationsController_createDestination: {
parameters: {
query?: never
header?: never
@@ -17367,17 +17381,17 @@ export interface operations {
}
requestBody: {
content: {
- 'application/json': components['schemas']['CreateReplicationPipelineBody']
+ 'application/json': components['schemas']['CreateReplicationDestinationBody']
}
}
responses: {
- /** @description Returns the created replication pipeline id. */
+ /** @description Returns the created replication destination id. */
201: {
headers: {
[name: string]: unknown
}
content: {
- 'application/json': components['schemas']['CreatePipelineResponse']
+ 'application/json': components['schemas']['CreateDestinationResponse']
}
}
403: {
@@ -17386,7 +17400,7 @@ export interface operations {
}
content?: never
}
- /** @description Failed to create pipeline */
+ /** @description Failed to create destination */
500: {
headers: {
[name: string]: unknown
@@ -17395,27 +17409,29 @@ export interface operations {
}
}
}
- ReplicationPipelinesController_getPipeline: {
+ ReplicationDestinationsPipelinesController_createDestinationPipeline: {
parameters: {
query?: never
header?: never
path: {
- /** @description Pipeline id */
- pipeline_id: number
/** @description Project ref */
ref: string
}
cookie?: never
}
- requestBody?: never
+ requestBody: {
+ content: {
+ 'application/json': components['schemas']['CreateReplicationDestinationPipelineBody']
+ }
+ }
responses: {
- /** @description Returns the pipeline. */
- 200: {
+ /** @description Returns the created replication destination and pipeline ids. */
+ 201: {
headers: {
[name: string]: unknown
}
content: {
- 'application/json': components['schemas']['ReplicationPipelineResponse']
+ 'application/json': components['schemas']['CreateDestinationPipelineResponse']
}
}
403: {
@@ -17424,7 +17440,7 @@ export interface operations {
}
content?: never
}
- /** @description Failed to get pipeline */
+ /** @description Returned when the API fails to create the replication destination or pipeline. */
500: {
headers: {
[name: string]: unknown
@@ -17433,21 +17449,23 @@ export interface operations {
}
}
}
- ReplicationPipelinesController_updatePipeline: {
+ ReplicationDestinationsPipelinesController_updateDestinationPipeline: {
parameters: {
query?: never
header?: never
path: {
+ /** @description Destination id */
+ destination_id: number
/** @description Pipeline id */
pipeline_id: number
- /** @description Project ref */
+ /** @description Project reference */
ref: string
}
cookie?: never
}
requestBody: {
content: {
- 'application/json': components['schemas']['UpdateReplicationPipelineBody']
+ 'application/json': components['schemas']['UpdateReplicationDestinationPipelineBody']
}
}
responses: {
@@ -17463,7 +17481,7 @@ export interface operations {
}
content?: never
}
- /** @description Failed to update pipeline */
+ /** @description Returned when the API fails to update the replication destination or pipeline */
500: {
headers: {
[name: string]: unknown
@@ -17472,21 +17490,25 @@ export interface operations {
}
}
}
- ReplicationPipelinesController_deletePipeline: {
+ ReplicationDestinationsController_updateDestination: {
parameters: {
query?: never
header?: never
path: {
- /** @description Pipeline id */
- pipeline_id: number
+ /** @description Destination id */
+ destination_id: number
/** @description Project ref */
ref: string
}
cookie?: never
}
- requestBody?: never
+ requestBody: {
+ content: {
+ 'application/json': components['schemas']['UpdateReplicationDestinationBody']
+ }
+ }
responses: {
- 200: {
+ 201: {
headers: {
[name: string]: unknown
}
@@ -17498,7 +17520,7 @@ export interface operations {
}
content?: never
}
- /** @description Failed to delete pipeline */
+ /** @description Failed to update destination */
500: {
headers: {
[name: string]: unknown
@@ -17507,13 +17529,13 @@ export interface operations {
}
}
}
- ReplicationPipelinesController_startPipeline: {
+ ReplicationDestinationsController_getDestination: {
parameters: {
query?: never
header?: never
path: {
- /** @description Pipeline id */
- pipeline_id: number
+ /** @description Destination id */
+ destination_id: number
/** @description Project ref */
ref: string
}
@@ -17521,11 +17543,14 @@ export interface operations {
}
requestBody?: never
responses: {
+ /** @description Returns the destination. */
200: {
headers: {
[name: string]: unknown
}
- content?: never
+ content: {
+ 'application/json': components['schemas']['ReplicationDestinationResponse']
+ }
}
403: {
headers: {
@@ -17533,7 +17558,7 @@ export interface operations {
}
content?: never
}
- /** @description Failed to start pipeline */
+ /** @description Failed to get destination */
500: {
headers: {
[name: string]: unknown
@@ -17542,13 +17567,13 @@ export interface operations {
}
}
}
- ReplicationPipelinesController_getPipelineStatus: {
+ ReplicationDestinationsController_deleteDestination: {
parameters: {
query?: never
header?: never
path: {
- /** @description Pipeline id */
- pipeline_id: number
+ /** @description Destination id */
+ destination_id: number
/** @description Project ref */
ref: string
}
@@ -17560,9 +17585,7 @@ export interface operations {
headers: {
[name: string]: unknown
}
- content: {
- 'application/json': components['schemas']['ReplicationPipelinesStatusResponse']
- }
+ content?: never
}
403: {
headers: {
@@ -17570,7 +17593,7 @@ export interface operations {
}
content?: never
}
- /** @description Failed to get pipeline status */
+ /** @description Failed to delete destination */
500: {
headers: {
[name: string]: unknown
@@ -17579,13 +17602,11 @@ export interface operations {
}
}
}
- ReplicationPipelinesController_stopPipeline: {
+ ReplicationPipelinesController_getPipelines: {
parameters: {
query?: never
header?: never
path: {
- /** @description Pipeline id */
- pipeline_id: number
/** @description Project ref */
ref: string
}
@@ -17597,7 +17618,9 @@ export interface operations {
headers: {
[name: string]: unknown
}
- content?: never
+ content: {
+ 'application/json': components['schemas']['ReplicationPipelinesResponse']
+ }
}
403: {
headers: {
@@ -17605,7 +17628,7 @@ export interface operations {
}
content?: never
}
- /** @description Failed to stop pipeline */
+ /** @description Failed to get replication pipeline */
500: {
headers: {
[name: string]: unknown
@@ -17614,7 +17637,7 @@ export interface operations {
}
}
}
- ReplicationSinksController_getSinks: {
+ ReplicationPipelinesController_createPipeline: {
parameters: {
query?: never
header?: never
@@ -17624,14 +17647,19 @@ export interface operations {
}
cookie?: never
}
- requestBody?: never
+ requestBody: {
+ content: {
+ 'application/json': components['schemas']['CreateReplicationPipelineBody']
+ }
+ }
responses: {
- 200: {
+ /** @description Returns the created replication pipeline id. */
+ 201: {
headers: {
[name: string]: unknown
}
content: {
- 'application/json': components['schemas']['ReplicationSinksResponse']
+ 'application/json': components['schemas']['CreatePipelineResponse']
}
}
403: {
@@ -17640,7 +17668,7 @@ export interface operations {
}
content?: never
}
- /** @description Failed to get replication sinks */
+ /** @description Failed to create pipeline */
500: {
headers: {
[name: string]: unknown
@@ -17649,29 +17677,27 @@ export interface operations {
}
}
}
- ReplicationSinksController_createSink: {
+ ReplicationPipelinesController_getPipeline: {
parameters: {
query?: never
header?: never
path: {
+ /** @description Pipeline id */
+ pipeline_id: number
/** @description Project ref */
ref: string
}
cookie?: never
}
- requestBody: {
- content: {
- 'application/json': components['schemas']['CreateReplicationSinkBody']
- }
- }
+ requestBody?: never
responses: {
- /** @description Returns the created replication sink id. */
- 201: {
+ /** @description Returns the pipeline. */
+ 200: {
headers: {
[name: string]: unknown
}
content: {
- 'application/json': components['schemas']['CreateSinkResponse']
+ 'application/json': components['schemas']['ReplicationPipelineResponse']
}
}
403: {
@@ -17680,7 +17706,7 @@ export interface operations {
}
content?: never
}
- /** @description Failed to create sink */
+ /** @description Failed to get pipeline */
500: {
headers: {
[name: string]: unknown
@@ -17689,11 +17715,13 @@ export interface operations {
}
}
}
- ReplicationSinksPipelinesController_createSinkPipeline: {
+ ReplicationPipelinesController_updatePipeline: {
parameters: {
query?: never
header?: never
path: {
+ /** @description Pipeline id */
+ pipeline_id: number
/** @description Project ref */
ref: string
}
@@ -17701,18 +17729,15 @@ export interface operations {
}
requestBody: {
content: {
- 'application/json': components['schemas']['CreateReplicationSinkPipelineBody']
+ 'application/json': components['schemas']['UpdateReplicationPipelineBody']
}
}
responses: {
- /** @description Returns the created replication sink and pipeline ids. */
201: {
headers: {
[name: string]: unknown
}
- content: {
- 'application/json': components['schemas']['CreateSinkPipelineResponse']
- }
+ content?: never
}
403: {
headers: {
@@ -17720,7 +17745,7 @@ export interface operations {
}
content?: never
}
- /** @description Returned when the API fails to create the replication sink or pipeline. */
+ /** @description Failed to update pipeline */
500: {
headers: {
[name: string]: unknown
@@ -17729,27 +17754,21 @@ export interface operations {
}
}
}
- ReplicationSinksPipelinesController_updateSinkPipeline: {
+ ReplicationPipelinesController_deletePipeline: {
parameters: {
query?: never
header?: never
path: {
/** @description Pipeline id */
pipeline_id: number
- /** @description Project reference */
+ /** @description Project ref */
ref: string
- /** @description Sink id */
- sink_id: number
}
cookie?: never
}
- requestBody: {
- content: {
- 'application/json': components['schemas']['UpdateReplicationSinkPipelineBody']
- }
- }
+ requestBody?: never
responses: {
- 201: {
+ 200: {
headers: {
[name: string]: unknown
}
@@ -17761,7 +17780,7 @@ export interface operations {
}
content?: never
}
- /** @description Returned when the API fails to update the replication sink or pipeline */
+ /** @description Failed to delete pipeline */
500: {
headers: {
[name: string]: unknown
@@ -17770,28 +17789,25 @@ export interface operations {
}
}
}
- ReplicationSinksController_getSink: {
+ ReplicationPipelinesController_startPipeline: {
parameters: {
query?: never
header?: never
path: {
+ /** @description Pipeline id */
+ pipeline_id: number
/** @description Project ref */
ref: string
- /** @description Sink id */
- sink_id: number
}
cookie?: never
}
requestBody?: never
responses: {
- /** @description Returns the sink. */
200: {
headers: {
[name: string]: unknown
}
- content: {
- 'application/json': components['schemas']['ReplicationSinkResponse']
- }
+ content?: never
}
403: {
headers: {
@@ -17799,7 +17815,7 @@ export interface operations {
}
content?: never
}
- /** @description Failed to get sink */
+ /** @description Failed to start pipeline */
500: {
headers: {
[name: string]: unknown
@@ -17808,29 +17824,27 @@ export interface operations {
}
}
}
- ReplicationSinksController_updateSink: {
+ ReplicationPipelinesController_getPipelineStatus: {
parameters: {
query?: never
header?: never
path: {
+ /** @description Pipeline id */
+ pipeline_id: number
/** @description Project ref */
ref: string
- /** @description Sink id */
- sink_id: number
}
cookie?: never
}
- requestBody: {
- content: {
- 'application/json': components['schemas']['UpdateReplicationSinkBody']
- }
- }
+ requestBody?: never
responses: {
- 201: {
+ 200: {
headers: {
[name: string]: unknown
}
- content?: never
+ content: {
+ 'application/json': components['schemas']['ReplicationPipelinesStatusResponse']
+ }
}
403: {
headers: {
@@ -17838,7 +17852,7 @@ export interface operations {
}
content?: never
}
- /** @description Failed to update sink */
+ /** @description Failed to get pipeline status */
500: {
headers: {
[name: string]: unknown
@@ -17847,15 +17861,15 @@ export interface operations {
}
}
}
- ReplicationSinksController_deleteSink: {
+ ReplicationPipelinesController_stopPipeline: {
parameters: {
query?: never
header?: never
path: {
+ /** @description Pipeline id */
+ pipeline_id: number
/** @description Project ref */
ref: string
- /** @description Sink id */
- sink_id: number
}
cookie?: never
}
@@ -17873,7 +17887,7 @@ export interface operations {
}
content?: never
}
- /** @description Failed to delete sink */
+ /** @description Failed to stop pipeline */
500: {
headers: {
[name: string]: unknown