import type { RdiMockHttpServer } from './RdiMockHttpServer'; import type { JobConfig, PipelineStateValueV1, PipelineStatusValue } from '../pipeline/types'; import { type SourceColumnMock, type SourceMetadataMock } from '../__tests__/integration/rawFixtures'; export interface SourceTableMockRow { name: string; columns?: number; inserted?: number; updated?: number; deleted?: number; filtered?: number; rejected?: number; } export type { SourceColumnMock, SourceMetadataMock }; /** * In-memory pipeline-mock overrides applied to monitoring routes. Updated * via the `POST /__mock/pipeline` control endpoint so the playground UI can * flip backend states without restarting the mock server. */ export interface PipelineMockState { /** Selects the primary source profile in the standalone playground mock. */ sourceType?: string; /** Overrides the `status` field of GET /pipelines/{name}/status. */ pipelineStatus?: PipelineStatusValue; /** * Overrides the collector-source metrics so the SDK derives this state * from GET /pipelines/{name}/metric-collections/collector-source_metrics. */ pipelineState?: PipelineStateValueV1; /** Named profile that gives the demo sources different collector run states. */ sourceStateProfile?: 'mixed' | 'mixed-cdc-failures'; /** * Custom error message injected into the `errors` array of * GET /pipelines/{name}/status. Only surfaces when `pipelineStatus` is * `error`; falls back to a generic message when omitted in that case. */ errorMessage?: string; /** Optional source collector error, independent from the pipeline status. */ collectorErrorMessage?: string; /** * How long a source removed by a config write keeps reporting its collector, * mimicking the teardown RDI keeps doing after the write returns. Set to `0` * for an instant removal. Defaults to {@link DEFAULT_SOURCE_TEARDOWN_MS}. */ sourceTeardownMs?: number; /** * Which processor RDI runs, deciding the shape *and* the name of the processor * metric collection: `processor_metrics` (component `processor`) for the classic * processor, `flink-processor_metrics` (component `flink-processor`) for Flink. * Defaults to `classic`. */ processorType?: 'classic' | 'flink'; } export interface E2eMockState extends PipelineMockState { /** Running Flink TaskManager replicas reported by the pipeline status endpoint. */ flinkProcessorRunningReplicas?: number; /** Flink TaskManager replicas requested by the deployed pipeline configuration. */ flinkProcessorConfiguredReplicas?: number; /** Flink processor component status reported by the pipeline status endpoint. */ flinkProcessorStatus?: 'started' | 'stopped'; sourceType?: string; sourceNames?: string[]; pipelineDataError?: boolean; monitoringStatisticsError?: boolean; actionFailures?: { start?: boolean; stop?: boolean; reset?: boolean; flushTarget?: boolean; downloadConfiguration?: boolean; }; sourceTableRows?: SourceTableMockRow[]; sourceMetadata?: Record; sourceMetadataBySource?: Record>; targetDatabases?: string[]; pipelineJobs?: JobConfig[]; /** * Full collector `metrics` payload served by every collector collection, * overriding the `pipelineState`-derived one — for scenarios that need * exact metric values (queue capacity, snapshot progress, missing fields). */ collectorMetrics?: Record; } export declare const registerRoutes: (server: RdiMockHttpServer) => void;