import { OAuthErrorResponse } from "./schemas/oauth.js"; /** * Base class for all OAuth errors that provides standardized error handling and response formatting. * This class implements the OAuth 2.0 error response format as specified in RFC 6749. */ export declare class OAuthError extends Error { readonly errorCode: string; readonly errorUri?: string | undefined; constructor(errorCode: string, message: string, errorUri?: string | undefined); /** * Converts the error to a standard OAuth error response object that follows the OAuth 2.0 specification. * The response includes the error code, description, and optional URI for additional error information. */ toResponseObject(): OAuthErrorResponse; } /** * Invalid request error (400) - Request is malformed or invalid. * Common causes: * - Missing required parameters * - Invalid parameter values * - Duplicate parameters */ export declare class InvalidRequestError extends OAuthError { constructor(message: string, errorUri?: string); } /** * Server error (500) - Unexpected server condition preventing request fulfillment. * Use when no other specific error code is appropriate. */ export declare class ServerError extends OAuthError { constructor(message: string, errorUri?: string); } /** * Invalid token error (401) - Access token is invalid or expired. * Common causes: * - Expired token * - Revoked token * - Invalid format * - Wrong client */ export declare class InvalidTokenError extends OAuthError { constructor(message: string, errorUri?: string); } /** * Method not allowed error (405) - HTTP method not supported for endpoint. * Custom extension of OAuth 2.0 for clearer method validation feedback. */ export declare class MethodNotAllowedError extends OAuthError { constructor(message: string, errorUri?: string); } /** * Invalid client metadata error (400) - Client registration metadata is invalid per RFC 7591. * Common causes: * - Missing required fields * - Invalid values * - Format errors * - Policy violations */ export declare class InvalidClientMetadataError extends OAuthError { constructor(message: string, errorUri?: string); } /** * Insufficient scope error (403) - Token lacks required permissions. * Common causes: * - Too narrow scope * - Restricted permissions * - Privilege requirements */ export declare class InsufficientScopeError extends OAuthError { constructor(message: string, errorUri?: string); } //# sourceMappingURL=errors.d.ts.map