import { IncomingMessage } from 'http';
import 'reflect-metadata';
import { Subject } from 'rxjs';
import sql from 'mssql';
import { DataSourceInfo, UserPayload } from './types.js';
import { DatabaseProviderBase } from '@memberjunction/core';
/**
 * Request context for API key usage logging.
 */
export interface RequestContext {
    /** The API endpoint path (e.g., '/graphql', '/mcp') */
    endpoint: string;
    /** HTTP method (e.g., 'POST', 'GET') */
    method: string;
    /** GraphQL operation name if available */
    operationName?: string;
    /** Client IP address */
    ipAddress?: string;
    /** User-Agent header */
    userAgent?: string;
}
export declare const getUserPayload: (bearerToken: string, sessionId: string, dataSources: DataSourceInfo[], requestDomain?: string, systemApiKey?: string, userApiKey?: string, requestContext?: RequestContext) => Promise<UserPayload>;
export declare const contextFunction: ({ setupComplete$, dataSource, dataSources }: {
    setupComplete$: Subject<unknown>;
    dataSource: sql.ConnectionPool;
    dataSources: DataSourceInfo[];
}) => ({ req }: {
    req: IncomingMessage;
}) => Promise<{
    dataSource: sql.ConnectionPool;
    dataSources: DataSourceInfo[];
    userPayload: UserPayload;
    providers: {
        provider: DatabaseProviderBase;
        type: "Read-Write" | "Read-Only";
    }[];
}>;
//# sourceMappingURL=context.d.ts.map