import { p as DiscoveredColumnMeta } from "./entity-config-OhC4Otkz.cjs"; import { Scored } from "./mapping-score.cjs"; //#region src/entity-heuristics.d.ts export declare const TARGET_CONCEPTS: readonly ["contact", "company", "deal", "activity", "conversation", "note"]; export type TargetConcept = (typeof TARGET_CONCEPTS)[number]; export declare function suggestCursorField(columnKeys: string[]): string | null; export declare function matchesConcept(tableName: string, concept: TargetConcept): { exact: boolean; } | null; export interface ScoredTable { columns: string[]; columnsMeta?: DiscoveredColumnMeta[]; name: string; rowCount?: number; } /** * Does this table carry credentials? Such tables are withheld from suggestions * and from bulk apply, so one click can never map an auth table into the CRM. * They stay manually selectable — an explicit, informed choice is legitimate. */ export declare function hasSensitiveColumns(columns: string[]): boolean; /** * Is this table one your auth library created, rather than one you wrote? * * Used to rank such tables below the developer's own when both could serve a * concept. Never to exclude them: mapping `user` as the contact entity is * legitimate for plenty of apps, and it stays selectable. */ export declare function isFrameworkTable(name: string): boolean; export declare function hasDefiningColumn(concept: TargetConcept, columns: string[]): boolean; export declare function scoreConcepts(table: ScoredTable): Scored[]; export declare function topConcept(table: ScoredTable): { best: Scored; ambiguous: boolean; } | null; export declare function requiredFieldsFor(concept: TargetConcept | "custom"): string[]; export declare function validateMapping(requiredFields: string[], fieldMap: Record): { valid: boolean; missing: string[]; }; export declare function suggestDiscriminatorColumns(columns: string[]): string[]; export type SuggestedVia = { fkOn: "company" | "contact"; column: string; } | { through: string; localKey: string; foreignKey: string; }; export interface RelationshipSuggestion { /** The related host table. */ entityTable: string; /** Suggested relationship name (defaults to the related concept). */ name: string; via: SuggestedVia; } /** * Suggest contact→company relationships. When the source table carries FK * metadata (`references`), the target table is a *fact*, not a name guess — * that scores highest. Without metadata (v1 hosts) we fall back to the legacy * FK-name hints at a lower tier. */ export declare function scoreRelationships(source: ScoredTable, allTables: ScoredTable[]): Scored[]; export interface FieldSuggestion { column: string; field: string; required: boolean; } export declare function scoreFieldMap(concept: TargetConcept, table: ScoredTable): Scored[]; export declare function toFieldMap(scored: Scored[]): Record; //#endregion export type { DiscoveredColumnMeta };