import { LineageGraph, type LineageGraphJSON, type LineageNode, type LineageEdge, type LineageNodeType, type LineageLayer } from './lineage-graph.js'; export interface LineageQuery { focus?: string; search?: string; types?: LineageNodeType[]; domain?: string; upstreamDepth?: number; downstreamDepth?: number; } export interface LineageQueryResult { graph: LineageGraphJSON; focalNode?: LineageNode; matches?: Array<{ node: LineageNode; score: number; }>; } export interface Business360Asset { id: string; name: string; type: LineageNodeType; layer: LineageLayer; domain?: string; status?: LineageNode['status']; owner?: string; metadata?: Record; } export interface Business360Edge { source: string; target: string; type: LineageEdge['type']; } export interface Business360Gap { code: 'missing_definition' | 'missing_composition' | 'missing_owner' | 'missing_terms' | 'missing_grain' | 'missing_outputs' | 'missing_reusable_filters' | 'missing_tests' | 'stale_review' | 'missing_sources' | 'missing_consumers'; severity: 'info' | 'warning'; message: string; } export type Business360Reusability = 'dynamic' | 'partial_dynamic' | 'static'; export interface Business360BlockContract { block: Business360Asset; pattern?: string; grain?: string; entities: string[]; outputs: string[]; dimensions: string[]; allowedFilters: string[]; parameterPolicy: Array<{ name: string; policy: string; }>; filterBindings: Array<{ filter: string; binding: string; }>; sourceSystems: string[]; replacementFor: string[]; reusability: Business360Reusability; } export interface Business360Result { focus: Business360Asset; businessDefinition: { terms: Business360Asset[]; definedArtifacts: Business360Asset[]; definedByTerms: Business360Asset[]; metadata: Record; }; businessComposition: { includedArtifacts: Business360Asset[]; parentViews: Business360Asset[]; }; technicalSources: { sourceTables: Business360Asset[]; dbtModels: Business360Asset[]; dbtSources: Business360Asset[]; upstreamBlocks: Business360Asset[]; upstreamPathCount: number; }; consumers: { dashboards: Business360Asset[]; apps: Business360Asset[]; notebooks: Business360Asset[]; downstreamViews: Business360Asset[]; downstreamBlocks: Business360Asset[]; }; replacementHistory: { replaces: Business360Asset[]; replacedBy: Business360Asset[]; replacementRefs: string[]; }; blockContracts: Business360BlockContract[]; gaps: Business360Gap[]; evidence: { nodes: Business360Asset[]; edges: Business360Edge[]; }; } /** Public v2 alias for the enterprise impact view shape. */ export type Business360ResultV2 = Business360Result; export interface Business360Options { /** Maximum upstream/downstream traversal depth (default 12). */ maxDepth?: number; } export declare function queryLineage(graph: LineageGraph, query: LineageQuery): LineageQueryResult; /** * Build a business-first 360 view around a term, block, business view, * dashboard, app, or notebook. * * Terms expand through outgoing `defines` edges first, then technical sources * and consuming artifacts are traced from the artifacts the term defines. */ export declare function queryBusiness360(graph: LineageGraph, focalNodeId: string, options?: Business360Options): Business360Result | null; export interface LineagePath { /** Nodes in order from start to end of the path */ nodes: LineageNode[]; /** Edges connecting the nodes in sequence */ edges: LineageEdge[]; /** Layers traversed in order */ layers: LineageLayer[]; } export interface CompletePathResult { /** The focal node this query centered on */ focalNode: LineageNode; /** Paths from sources (roots) to the focal node */ upstreamPaths: LineagePath[]; /** Paths from the focal node to consumption (leaves) */ downstreamPaths: LineagePath[]; /** Layer distribution summary */ layerSummary: Record; } export interface CompletePathOptions { /** Maximum traversal depth (default 10) */ maxDepth?: number; /** Maximum number of paths to return per direction (default 20) */ maxPaths?: number; } /** * Compute complete lineage paths for a focal node. * * Upstream paths trace from source roots to the focal node. * Downstream paths trace from the focal node to consumption leaves. * Paths are deduplicated and capped to avoid explosion on large graphs. */ export declare function queryCompleteLineagePaths(graph: LineageGraph, focalNodeId: string, options?: CompletePathOptions): CompletePathResult | null; //# sourceMappingURL=query.d.ts.map