import { DataSource, StorageEngine } from "../storage.mjs"; import { Row, TableName, TenantCtx } from "@gscdump/contracts"; import { SearchType } from "gscdump/query"; interface NodeHarnessOptions { dataDir: string; /** Tenant user id. Defaults to `'local'` for single-user CLI installs. */ userId?: string; /** Name of the manifest file under `dataDir`. Defaults to `manifest.json`. */ manifestFilename?: string; } interface NodeHarness { engine: StorageEngine; /** * Underlying filesystem-backed DataSource. Exposed so commands that write * derivative artifacts (rollups, exports) don't have to re-instantiate it. */ dataSource: DataSource; dataDir: string; userId: string; siteIdFor: (siteUrl: string) => string; withSitemapMutation: (ctx: TenantCtx, mutate: () => Promise) => Promise; runRawSql: (opts: { sql: string; siteUrl: string; table: TableName; params?: unknown[]; /** * Restrict the underlying manifest lookup to a single GSC search-type * slice. Undefined keeps the legacy cross-type union. */ searchType?: SearchType; }) => Promise<{ rows: Row[]; sql: string; keys: string[]; }>; } declare function createNodeHarness(opts: NodeHarnessOptions): NodeHarness; export { NodeHarness, NodeHarnessOptions, createNodeHarness };