import { BuildAuthInfoFromBearerOptions, OAuthBridgePaths } from '@solvapay/mcp-core'; export { BuildAuthInfoFromBearerOptions, McpBearerAuthError, McpBearerCustomerRefOptions, OAuthAuthorizationServerOptions, OAuthBridgePaths, buildAuthInfoFromBearer, decodeJwtPayload, extractBearerToken, getCustomerRefFromBearerAuthHeader, getCustomerRefFromJwtPayload, getOAuthAuthorizationServerResponse, getOAuthProtectedResourceResponse } from '@solvapay/mcp-core'; /** * Node `(req, res, next)` OAuth bridge middleware for the SolvaPay MCP * server. * * Lifted verbatim from `@solvapay/mcp-express` when it was folded into * this package as a subpath export. Pure JSON discovery builders come * from `@solvapay/mcp-core`; everything request/response-shaped lives * here so `@solvapay/mcp-core` stays runtime-agnostic. */ type RequestLike = { method?: string; path?: string; url?: string; headers?: Record; body?: unknown; auth?: unknown; }; type ResponseLike = { status: (code: number) => ResponseLike; json: (payload: unknown) => void; setHeader: (name: string, value: string) => void; end?: (body?: string) => void; send?: (body?: string | Buffer) => void; }; type NextLike = () => void; type Middleware = (req: RequestLike, res: ResponseLike, next: NextLike) => void | Promise; interface OAuthRegisterHandlerOptions { apiBaseUrl: string; productRef: string; path?: string; } interface OAuthAuthorizeHandlerOptions { apiBaseUrl: string; path?: string; } interface OAuthTokenHandlerOptions { apiBaseUrl: string; path?: string; } interface OAuthRevokeHandlerOptions { apiBaseUrl: string; path?: string; } interface McpOAuthBridgeOptions { publicBaseUrl: string; apiBaseUrl: string; productRef: string; mcpPath?: string; requireAuth?: boolean; authInfo?: BuildAuthInfoFromBearerOptions; protectedResourcePath?: string; authorizationServerPath?: string; oauthPaths?: OAuthBridgePaths; } declare function createOAuthRegisterHandler(options: OAuthRegisterHandlerOptions): Middleware; declare function createOAuthAuthorizeHandler(options: OAuthAuthorizeHandlerOptions): Middleware; declare function createOAuthTokenHandler(options: OAuthTokenHandlerOptions): Middleware; declare function createOAuthRevokeHandler(options: OAuthRevokeHandlerOptions): Middleware; declare function createMcpOAuthBridge(options: McpOAuthBridgeOptions): Middleware[]; export { type McpOAuthBridgeOptions, type OAuthAuthorizeHandlerOptions, type OAuthRegisterHandlerOptions, type OAuthRevokeHandlerOptions, type OAuthTokenHandlerOptions, createMcpOAuthBridge, createOAuthAuthorizeHandler, createOAuthRegisterHandler, createOAuthRevokeHandler, createOAuthTokenHandler };