import { Driver, Session } from "neo4j-driver"; export declare function getDriver(): Driver; export declare function getSession(): Session; export declare function closeDriver(): Promise; /** * Thrown by getUserTimezone when there is no resolvable identity to key the * UserProfile read on: the account has no owner `AdminUser` AND no acting * userId was threaded. Surfaces the unresolvable case rather than letting the * read silently widen to an account-wide query that would target a * non-deterministic UserProfile row. * * Task 1895 — an empty acting userId on its own is NOT this error. An * `adminPhones` sender with no `users.json` binding gets an empty `USER_ID` * by design (`platform/plugins/docs/references/admin-identity-gate.md`), and * the owner resolution introduced by Task 1684 answers that case from the * graph. */ export declare class MissingUserIdError extends Error { constructor(message: string); } /** * Task 1684 — resolve the account's seeded owner `AdminUser` userId. * * A sub-account is seeded (Task 1359 `seedAccountGraphRoot`) with exactly one * `AdminUser {role:'owner'}`. When a house operator acts inside that * sub-account, the operator's boot userId has no node in the sub-account * subgraph, so keying a UserProfile read on it reads empty. The owner is the * single, unambiguous locale identity for the account. Returns null when the * account has no owner `AdminUser` (a legacy, pre-1359 account) — the caller * then falls back to the acting user via an explicit, logged path. * * Mirrors the memory plugin's `resolve-owner-userid.ts` and * `@maxy/active-rules`' `resolveOwnerUserId` — the query literal is duplicated * per package deliberately (each keeps its own neo4j coupling) rather than * introducing a cross-package import. */ export declare function resolveOwnerUserId(session: Session, accountId: string): Promise; /** * Fetches the account's IANA timezone from its owner's UserProfile node. * * UserProfile read doctrine: single-row consumers key reads on * (accountId, userId). AccountId-only reads are forbidden — the constraint * enforces (accountId, userId) uniqueness, so a bare-accountId read would * target a non-deterministic row and (in multi-row state) point the caller at * a remediation that writes to a different row than the read. * * Task 1684: the read is keyed on the account's seeded OWNER, not the acting * session user. A house operator acting inside a client sub-account has no * UserProfile scoped to that account; the owner's profile is authoritative * (the same owner-resolution 1557/1564 applied to profile writes and standing * rules). The acting user is used only as an explicit fallback when the * account has no seeded owner (legacy), which also preserves the pre-1684 * behaviour for single-identity accounts where the acting user IS the owner. * * Task 1895: the rejection tests the RESOLVED identity, not the acting userId. * MissingUserIdError is raised only when owner resolution returns null AND no * acting userId was threaded — there is then nothing to key the read on. An * empty acting userId with a seeded owner resolves normally. * Throws Error when no UserProfile exists for the resolved (accountId, userId) * pair — the message names the resolved row (owner, or acting user in the * fallback) so profile-update targets the same row that was read. * Throws Error when the row exists but timezone is unset — same naming. */ export declare function getUserTimezone(accountId: string, userId: string): Promise; //# sourceMappingURL=neo4j.d.ts.map