/** * Draft API types. * * These types originate from the auto-generated API types document * (ComposeDraft* interfaces) and were adapted for use in the pipeline package. */ export interface ComposeDraftAdvanced { processor?: object; } export interface UiDraftClientDataMeta { finishedOn?: string; } /** * Per-source UI-only metadata, persisted in the draft's opaque `clientData` * bag. Parallel to (and same order as) `UiDraft.sources`. Additive: an old * single-source draft carries these as flat top-level `clientData` fields * describing its one source; `sources[0]` mirrors them for backward compat. */ export interface UiDraftSourceClientData { isSourceTested?: boolean; isSourceSecretsValidated?: boolean; awsPrivateLinkServiceName?: string; } export interface UiDraftClientData extends UiDraftClientDataMeta { /** Per-source client metadata, aligned by index with `UiDraft.sources`. */ sources?: UiDraftSourceClientData[]; [key: string]: unknown; } /** * Unified draft shape used throughout the pipeline package. * Originally called `ComposeDraftResponse` in the auto-generated API types. */ export interface UiDraft { draftId?: string; targetDataType?: UiDraftTargetDataTypeEnum; /** * Legacy single-source field: a copy of `sources[0]`, kept so software that * predates multi-source still finds one source where it expects. Reads * prefer `sources` when present (Design 004, "Storing a Draft With Many * Sources"). */ source?: UiDraftUpsertRequestSource; /** * The full list of sources — the source of truth for multi-source drafts. * When present (even if empty) it wins over `source`; when absent the draft * is an old single-source one and `source` is used. Deliberately a list, not * a name-keyed map: each source already carries its `name`. */ sources?: Array; target?: ComposeDraftTarget; advanced?: ComposeDraftAdvanced; schemas?: Array; jobs?: Array; clientData?: UiDraftClientData; createdAt?: string; updatedAt?: string; } export declare const UiDraftTargetDataTypeEnum: { readonly Hash: 'hash'; readonly Json: 'json'; }; export type UiDraftTargetDataTypeEnum = (typeof UiDraftTargetDataTypeEnum)[keyof typeof UiDraftTargetDataTypeEnum]; /** @type ComposeDraftSource — discriminated union by databaseType */ export type ComposeDraftSource = ({ databaseType: 'mariadb'; } & MariaDbSource) | ({ databaseType: 'mongodb'; } & MongodbSource) | ({ databaseType: 'mysql'; } & MySqlSource) | ({ databaseType: 'oracle'; } & OracleSource) | ({ databaseType: 'postgresql'; } & PostgresqlSource) | ({ databaseType: 'snowflake'; } & SnowflakeSource) | ({ databaseType: 'sqlserver'; } & SqlServerSource); export type UiDraftUpsertRequestSource = (MariaDbSource | MongodbSource | MySqlSource | OracleSource | PostgresqlSource | SnowflakeSource | SqlServerSource) & SourceCredentials; export interface SourceCredentials { username?: string; password?: string; } export interface MariaDbSource { name?: string; endpointId?: string; host?: string; databaseType?: string; database?: string; port?: number; secretArns?: { [key: string]: string; }; sourceAdvanced?: object; sinkAdvanced?: object; } export interface MongodbSource { name?: string; endpointId?: string; host?: string; databaseType?: string; database?: string; port?: number; secretArns?: { [key: string]: string; }; connectionString?: string; sourceAdvanced?: object; sinkAdvanced?: object; } export interface MySqlSource { name?: string; endpointId?: string; host?: string; databaseType?: string; database?: string; port?: number; secretArns?: { [key: string]: string; }; sourceAdvanced?: object; sinkAdvanced?: object; } export interface OracleSource { name?: string; endpointId?: string; host?: string; databaseType?: string; database?: string; port?: number; secretArns?: { [key: string]: string; }; pdb?: string; sourceAdvanced?: object; sinkAdvanced?: object; } export interface PostgresqlSource { name?: string; endpointId?: string; host?: string; databaseType?: string; database?: string; port?: number; secretArns?: { [key: string]: string; }; sourceAdvanced?: object; sinkAdvanced?: object; } export interface SnowflakeSource { name?: string; endpointId?: string; host?: string; databaseType?: string; database?: string; port?: number; secretArns?: { [key: string]: string; }; accountIdentifier?: string; warehouse?: string; role?: string; cdcDatabase?: string; cdcSchema?: string; sourceAdvanced?: object; sinkAdvanced?: object; } export interface SqlServerSource { name?: string; endpointId?: string; host?: string; databaseType?: string; database?: string; port?: number; secretArns?: { [key: string]: string; }; sourceAdvanced?: object; sinkAdvanced?: object; } export interface ComposeDraftTarget { /** Cloud-only selected target database id (optional). */ targetBdbId?: number; /** Common on-prem/self-hosted target connection fields. */ host?: string; port?: number; username?: string; password?: string; database?: string; databaseType?: string; ssl?: boolean; } export interface Job { name: string; file: string; error?: WebError; rdiJob?: { [key: string]: unknown; }; } export interface Schema { name: string; /** * Names the owning source (matches a `sources[].name`). Schemas stay a * single top-level list; `sourceRef` is how each one knows its source. Only * written for multi-source drafts — an untagged schema belongs to the first * source (old single-source draft). Distinct from the display-label * `sourceName` (Design 004, "How schemas know their source"). */ sourceRef?: string; tables?: Array; } export interface Table { name: string; columns?: Array; snapshot_sql?: string; } export interface TableColumn { name: string; uniqueConstraint?: boolean; } export interface WebError { timestamp?: number; status?: number; code?: string; message?: string; params?: string; }