import { Driver, Session, Transaction, ManagedTransaction, QueryResult } from 'neo4j-driver'; /** * Minimal logger interface. Compatible with NestJS Logger, console, pino, etc. * * `warn` is optional so existing logger implementations remain compatible. * The OGM uses it for security-sensitive events (policy bypass, raw cypher * execution); when not provided it silently no-ops. */ export interface OGMLogger { debug(message: string, ...args: unknown[]): void; warn?(message: string, ...args: unknown[]): void; } /** * Execution context for running queries within an existing transaction or session. * * Supports both legacy pattern (`executionContext`) and new explicit pattern (`transaction`/`session`). * When both are provided, `executionContext` takes precedence for backward compatibility. */ export interface ExecutionContext { /** @deprecated Use `transaction` instead. Kept for backward compatibility with @neo4j/graphql-ogm. */ executionContext?: Transaction | ManagedTransaction; /** Explicit transaction to run the query within. */ transaction?: Transaction | ManagedTransaction; /** Explicit session to use (auto-committed). */ session?: Session; /** * Optional metadata to attach to the underlying transaction. Forwarded * via `tx.setMetaData(...)` (or session config for auto-commit). Used * by the OGM's policy layer to surface audit fields * (`ogmPolicySetVersion`, `ctxFingerprint`, `modelType`, `operation`, * `policiesEvaluated`, `bypassed`). Failures to set metadata are * logged at `debug` and do not block query execution. */ metadata?: Record; } /** Per-call execution options that are not part of `ExecutionContext`. */ export interface ExecuteOptions { /** * Access mode for the auto-commit session the executor opens itself. * `'READ'` makes the server reject any write in the statement. Ignored * when the caller supplies a `transaction` / `session` — the caller * owns the access mode of those. Omitted → the driver default. */ accessMode?: 'READ' | 'WRITE'; } /** * Executes Cypher queries against Neo4j, using either a provided * transaction or an auto-commit session. */ export declare class Executor { private driver; /** Set to true to enable debug logging. */ static debug: boolean; private logger; constructor(driver: Driver, logger?: OGMLogger); /** * Execute a Cypher query, using either the provided transaction * or a new auto-commit session. */ execute(cypher: string, params: Record, context?: ExecutionContext, options?: ExecuteOptions): Promise; /** * Attach OGM-managed metadata to an existing transaction. Failures * (older drivers without `setMetaData`, or already-finished tx) are * swallowed at debug — auditing must never block a query. */ private attachMetadata; } //# sourceMappingURL=executor.d.ts.map