/** * Build OpenLineage events from a compiled DQL manifest. * * Turns a `dql compile` artifact into a START/COMPLETE event series that * hydrates a Marquez / DataHub / Atlan / Monte Carlo backend with the * project's lineage graph: dbt sources → dbt models → DataLex contracts → * DQL blocks → apps. * * Use {@link buildEventsFromManifest} for tests / inspection (returns a * pure array of events) and {@link emitProjectSnapshot} to actually POST * to the configured backend. */ import type { LineageEvent, OpenLineageEmitter } from './index.js'; /** * Subset of `@duckcodeailabs/dql-core` `DQLManifest` consumed here. Kept * structural to avoid a circular package dep — dql-openlineage stays * dependency-free. */ export interface ManifestProjection { blocks?: Record; /** Optional dbt model index, when the manifest exposes one. */ dbtModels?: Record; /** Optional DataLex contracts surface (forwarded by the manifest builder). */ datalexContracts?: ManifestDataLexContractProjection[]; } export interface ManifestBlockProjection { name: string; status?: string; filePath?: string; domain?: string; owner?: string; blockType?: string; description?: string; /** Tables the block reads from (output of the lineage table extractor). */ tableDependencies?: string[]; /** Block-to-block ref() edges. */ refDependencies?: string[]; /** Optional reference to a DataLex contract id. */ datalexContract?: string; /** Column-level outputs from the v2.4 column-lineage pipeline. */ outputs?: Array<{ name: string; isAggregate?: boolean; aggregateFn?: string; sources: Array<{ table: string; column: string; }>; unresolved?: boolean; }>; } export interface ManifestDbtModelProjection { name: string; schema?: string; database?: string; } export interface ManifestDataLexContractProjection { id: string; domain?: string; entity?: string; version?: number; } export interface BuildEventsOptions { /** OpenLineage namespace; defaults to `dql`. Producer-side default. */ namespace?: string; /** ISO-8601 timestamp; defaults to `new Date().toISOString()`. */ eventTime?: string; /** * Run id supplier. Defaults to a per-event UUID. Tests pass a counter * so output is deterministic. */ newRunId?: () => string; /** Filter blocks by status; defaults to ['certified']. */ blockStatuses?: string[]; } /** OpenLineage dataset name conventions for DQL artifacts. */ export declare const datasetNames: { dbtModel(modelName: string): string; dataLexContract(contractId: string): string; dqlBlock(blockName: string): string; }; /** OpenLineage job name conventions. */ export declare const jobNames: { blockRun(blockName: string): string; }; export declare function buildEventsFromManifest(manifest: ManifestProjection, options?: BuildEventsOptions): LineageEvent[]; /** * Emit a complete project snapshot through the supplied emitter. Each * certified block produces a START / COMPLETE pair so a backend like * Marquez can reconstruct the full lineage graph in one pass. */ export declare function emitProjectSnapshot(emitter: OpenLineageEmitter, manifest: ManifestProjection, options?: BuildEventsOptions): Promise<{ emitted: number; }>; //# sourceMappingURL=manifest-events.d.ts.map