feat: run pinned pipelines and publish outputs
This commit is contained in:
@@ -146,6 +146,7 @@ export type TabularSource = {
|
||||
source_name: string;
|
||||
name: string;
|
||||
description?: string | null;
|
||||
mode: "live" | "cached" | "static";
|
||||
columns: TabularSourceColumn[];
|
||||
schema_version: string;
|
||||
fingerprint: string;
|
||||
@@ -161,6 +162,31 @@ export type TabularSourceCatalogue = {
|
||||
sources: TabularSource[];
|
||||
};
|
||||
|
||||
export type PipelineRun = {
|
||||
ref: string;
|
||||
pipeline_id: string;
|
||||
revision: number;
|
||||
run_type: string;
|
||||
status: "running" | "succeeded" | "failed" | "cancelled";
|
||||
idempotency_key?: string | null;
|
||||
definition_hash: string;
|
||||
executor_version: string;
|
||||
source_fingerprints: Record<string, unknown>[];
|
||||
result_schema: PreviewColumn[];
|
||||
diagnostics: DataflowDiagnostic[];
|
||||
input_row_count: number;
|
||||
output_row_count: number;
|
||||
output_publication_ref?: string | null;
|
||||
output_datasource_ref?: string | null;
|
||||
output_materialization_ref?: string | null;
|
||||
error?: string | null;
|
||||
started_at: string;
|
||||
finished_at?: string | null;
|
||||
created_by?: string | null;
|
||||
created_at: string;
|
||||
replayed: boolean;
|
||||
};
|
||||
|
||||
export async function listDataflowNodeTypes(settings: ApiSettings): Promise<NodeTypeDefinition[]> {
|
||||
const response = await apiFetch<{ nodes: NodeTypeDefinition[] }>(
|
||||
settings,
|
||||
@@ -280,3 +306,43 @@ export function previewDataflowPipeline(
|
||||
body: JSON.stringify(payload)
|
||||
});
|
||||
}
|
||||
|
||||
export async function listDataflowPipelineRuns(
|
||||
settings: ApiSettings,
|
||||
pipelineId: string
|
||||
): Promise<PipelineRun[]> {
|
||||
const response = await apiFetch<{ runs: PipelineRun[] }>(
|
||||
settings,
|
||||
`/api/v1/dataflow/pipelines/${encodeURIComponent(pipelineId)}/runs?limit=25`
|
||||
);
|
||||
return response.runs;
|
||||
}
|
||||
|
||||
export function runDataflowPipeline(
|
||||
settings: ApiSettings,
|
||||
pipelineId: string,
|
||||
payload: {
|
||||
revision: number;
|
||||
idempotency_key: string;
|
||||
row_limit?: number;
|
||||
publication?: {
|
||||
target_datasource_ref?: string | null;
|
||||
name?: string | null;
|
||||
source_name?: string | null;
|
||||
description?: string | null;
|
||||
freeze?: boolean;
|
||||
frozen_label?: string | null;
|
||||
set_current?: boolean;
|
||||
metadata?: Record<string, unknown>;
|
||||
} | null;
|
||||
}
|
||||
): Promise<PipelineRun> {
|
||||
return apiFetch(
|
||||
settings,
|
||||
`/api/v1/dataflow/pipelines/${encodeURIComponent(pipelineId)}/runs`,
|
||||
{
|
||||
method: "POST",
|
||||
body: JSON.stringify(payload)
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user