import type { Blueprint } from '../core/config/schema.js'; import type { ResolvedDatabase } from '../core/config/index.js'; /** * Everything that determines a template's contents. Serialized and hashed; * anything omitted here is something two runs may disagree about while still * sharing a template, so omissions are the way stale reuse happens. */ export interface TemplateInputs { /** Which configured database this template stands in for. */ readonly databaseName: string; /** * The role that builds — and therefore owns — the template. * * `CREATE DATABASE ... WITH TEMPLATE` requires ownership of the template, so * a template is only shareable among processes connecting as the same role. * Keying on the owner means a second role builds its own rather than failing * to clone, or worse, trying to drop a database it does not own. */ readonly owner: string; readonly extensions: readonly string[]; readonly migrationTable: string; /** Hash of the migrations folder's contents, or `null` when unmigrated. */ readonly migrations: string | null; /** Framework-table provisioning depends on these blueprint sections. */ readonly trace: unknown; readonly audit: unknown; /** Framework tables ride the default database only. */ readonly isDefaultDatabase: boolean; /** Trace/audit day partitions are provisioned relative to the current day. */ readonly partitionDay: string; /** Internal definitions and emitted DDL travel with the pipework version. */ readonly pipeworkVersion: string; readonly formatVersion: number; } /** * Hash a migrations folder's contents: every file's path relative to the folder * and its bytes, in a stable order. Path names are included so a rename is a * change; a missing or unreadable folder hashes as absent. */ export declare function hashMigrationsFolder(folder: string): string | null; /** * Collect the content inputs for one configured database's template. * * `partitionDay` is the current UTC date. Trace and audit partitions are * created per day with a lead window, so a template built yesterday is missing * today's partitions — keying on the day makes that invalidation automatic * instead of a stale-data bug that only shows up after midnight. */ export declare function templateInputs(databaseName: string, dbConfig: ResolvedDatabase, blueprint: Blueprint, isDefaultDatabase: boolean, today: Date): TemplateInputs; /** * The template's content fingerprint: 16 lowercase hex chars. Deliberately * wider than the 12-char per-run nonce so a template name can never be mistaken * for a run-owned database name. */ export declare function templateFingerprint(inputs: TemplateInputs): string; //# sourceMappingURL=fingerprint.d.ts.map