/** * Shared TypeScript types for AuthSec SDK */ /** MCP content item returned by tool handlers */ export interface McpContent { type: string; text: string; } /** Async tool handler function (no session) */ export type ToolHandler = (arguments_: Record) => Promise; /** Async tool handler function (with session) */ export type ToolHandlerWithSession = (arguments_: Record, session: SimpleSession) => Promise; /** RBAC requirements for a protected tool */ export interface RbacRequirements { roles: string[]; groups: string[]; resources: string[]; scopes: string[]; permissions: string[]; requireAll: boolean; } /** Tool definition with metadata (returned by decorator functions) */ export interface ToolDefinition { /** The wrapped handler function */ handler: (arguments_: Record) => Promise; /** Tool name */ name: string; /** Tool description */ description?: string; /** MCP-compliant JSON schema for input */ inputSchema?: Record; /** Whether this tool is protected by AuthSec */ isProtected: boolean; /** RBAC requirements (only for protected tools) */ rbacRequirements?: RbacRequirements; } /** Session object passed to protected tool handlers */ export declare class SimpleSession { sessionId: string; accessToken: string | null; workspaceId: string | null; userId: string | null; orgId: string | null; constructor(sessionId: string, userInfo: Record); } /** User info extracted from JWT / auth service */ export interface UserInfo { email?: string; workspace_id?: string; user_id?: string; org_id?: string; access_token?: string; roles?: string[]; groups?: string[]; scopes?: string[] | string; scope?: string[] | string; resources?: string[]; permissions?: string[]; [key: string]: any; } /** Service credentials returned by ServiceAccessSDK */ export interface ServiceCredentials { serviceId: string; serviceName: string; serviceType: string; authType: string; url: string; credentials: Record; metadata: Record; retrievedAt: string; } /** SDK configuration */ export interface AuthSecConfig { clientId: string | null; appName: string | null; authServiceUrl: string; servicesBaseUrl: string; timeout: number; retries: number; spireSocketPath: string | null; spireEnabled: boolean; } /** MCP JSON-RPC message */ export interface McpMessage { jsonrpc: string; id?: string | number | null; method?: string; params?: Record; result?: any; error?: { code: number; message: string; }; } //# sourceMappingURL=types.d.ts.map