/** * Lineage Builder — assembles the full answer-layer lineage graph. * * Walks DQL blocks and semantic layer definitions to build a complete * LineageGraph connecting source tables → blocks → metrics → charts, * with domain boundaries and certification edges. */ import { LineageGraph } from './lineage-graph.js'; export interface LineageBlockInput { name: string; sql: string; domain?: string; owner?: string; status?: 'draft' | 'review' | 'certified' | 'deprecated' | 'pending_recertification'; certifiedBy?: string; /** Block type: custom, semantic, etc. */ blockType?: string; /** Metric reference for semantic blocks */ metricRef?: string; /** Metric references for semantic blocks */ metricsRef?: string[]; /** Dimension references for semantic blocks */ dimensionsRef?: string[]; /** Chart type from visualization config */ chartType?: string; /** Materialized table/view name */ materializedAs?: string; /** File path of the block definition */ filePath?: string; description?: string; businessOutcome?: string; reviewCadence?: string; tests?: string[]; /** Business glossary terms this block implements or depends on. */ termRefs?: string[]; pattern?: string; grain?: string; entities?: string[]; declaredOutputs?: string[]; dimensions?: string[]; allowedFilters?: string[]; parameterPolicy?: Array<{ name: string; policy: string; }>; filterBindings?: Array<{ filter: string; binding: string; }>; sourceSystems?: string[]; replacementFor?: string[]; } export interface LineageMetricInput { name: string; table: string; domain?: string; type: string; status?: 'draft' | 'review' | 'certified' | 'deprecated' | 'pending_recertification'; owner?: string; filePath?: string; description?: string; sql?: string; tags?: string[]; } export interface LineageDimensionInput { name: string; table: string; domain?: string; type?: string; status?: 'draft' | 'review' | 'certified' | 'deprecated' | 'pending_recertification'; owner?: string; filePath?: string; description?: string; sql?: string; tags?: string[]; } export interface LineageBuilderOptions { /** Known block names for implicit dependency resolution */ blockNames?: Set; dbtModels?: LineageDbtModelInput[]; dashboards?: LineageDashboardInput[]; businessViews?: LineageBusinessViewInput[]; terms?: LineageTermInput[]; domains?: LineageDomainInput[]; /** * Apps (consumption-layer artifacts) that contain dashboards. App nodes sit * above the matching dashboard nodes in the graph and inherit the App's * declared `domain` so cross-domain analysis remains accurate. */ apps?: LineageAppInput[]; } export interface LineageDomainInput { name: string; owner?: string; businessOwner?: string; boundedContext?: string; filePath?: string; sourceSystems?: string[]; primaryTerms?: string[]; reviewCadence?: string; businessOutcome?: string; tags?: string[]; } export interface LineageBusinessViewInput { name: string; domain?: string; owner?: string; status?: 'draft' | 'review' | 'certified' | 'deprecated' | 'pending_recertification'; filePath?: string; description?: string; businessOutcome?: string; reviewCadence?: string; blockRefs: string[]; businessViewRefs: string[]; termRefs?: string[]; declaredTermRefs?: string[]; } export interface LineageTermInput { name: string; domain?: string; owner?: string; status?: 'draft' | 'review' | 'certified' | 'deprecated' | 'pending_recertification'; termType?: string; filePath?: string; description?: string; identifiers?: string[]; synonyms?: string[]; businessOutcome?: string; reviewCadence?: string; } export interface LineageAppInput { id: string; name: string; domain?: string; owner?: string; filePath?: string; /** Dashboard ids contained by this App (matched against `dashboard:` nodes). */ dashboards: string[]; } export interface LineageDbtModelInput { name: string; uniqueId: string; type: 'model' | 'source'; dependsOn: string[]; columns?: Array<{ name: string; type?: string; description?: string; }>; schema?: string; database?: string; materialized?: string; description?: string; } export interface LineageDashboardInput { name: string; kind?: 'dashboard' | 'notebook'; blocks: string[]; charts: string[]; /** File path of the notebook */ filePath?: string; /** Block names referenced via ref() in SQL cells */ refDependencies?: string[]; /** Table names referenced in SQL cells (for tracing non-block SQL) */ tableDependencies?: string[]; } /** * Build a complete lineage graph from blocks and semantic definitions. */ export declare function buildLineageGraph(blocks: LineageBlockInput[], metrics: LineageMetricInput[], dimensions: LineageDimensionInput[], options?: LineageBuilderOptions): LineageGraph; //# sourceMappingURL=builder.d.ts.map