export type RoleRelationshipDirection = "inherits" | "member"; export type RoleRelationshipCatalogRow = { relationship: string; direction: RoleRelationshipDirection; server_version_num: number; admin_option: boolean | null; inherit_option: boolean | null; set_option: boolean | null; member_is_superuser: boolean | null; member_can_create_role: boolean | null; grantor_role: string | null; grantor_is_superuser: boolean | null; }; export type ClassifiedRoleRelationships = { relationships: string[]; managementOnlyRelationships: string[]; unsafeRelationships: string[]; }; type RoleTargetExpression = "current_user" | "$1"; /** * One PostgreSQL 15-compatible catalog query for both provisioning and runtime * posture. PostgreSQL 16 added per-membership INHERIT and SET columns; reading * the catalog row through to_jsonb keeps this statement parseable on 15 while * leaving the missing options null and therefore fail-closed. */ export declare function roleRelationshipsCatalogQuery(targetRole: RoleTargetExpression): string; /** * PostgreSQL 16+ automatically gives a non-superuser CREATEROLE principal an * ADMIN-only grant on a role it creates. The exact edge below permits role * management but cannot inherit the app role's privileges or SET ROLE into it. */ export declare function isManagementOnlyRoleRelationship(row: RoleRelationshipCatalogRow): boolean; /** Classify exact management-only reverse grants while rejecting every other edge. */ export declare function classifyRoleRelationships(rows: readonly RoleRelationshipCatalogRow[]): ClassifiedRoleRelationships; export {};