/** * Build ingestion — the main entry point for storing a parsed `BuildConfig` * into MongoDB. * * Usage: * ```ts * import { ingestBuild } from "@ondc/build-tools/store"; * * const result = await ingestBuild(db, parsedConfig); * if (result.skipped) { * console.log("Build already ingested (identical hash)."); * } else { * console.log(`Ingested ${result.domain}@${result.version} — ${result.changes} changes`); * } * ``` */ import type { Db } from "mongodb"; import type { BuildConfig } from "../types/build-type.js"; import type { StoredChangeLog } from "./schemas.js"; export type IngestResult = { skipped: true; domain: string; version: string; buildHash: string; } | { skipped: false; domain: string; version: string; buildHash: string; changes: number; changelog: StoredChangeLog | null; }; /** * Stores a parsed `BuildConfig` into MongoDB, split across multiple * collections. Idempotent — if the build hash hasn't changed, the write is * skipped entirely. * * @param db - A connected MongoDB `Db` instance. The caller owns the connection. * @param config - A fully parsed and validated `BuildConfig`. * @returns An `IngestResult` indicating whether the build was stored or skipped. */ export declare function ingestBuild(db: Db, config: BuildConfig): Promise; //# sourceMappingURL=ingest.d.ts.map