UNPKG

@simpleapps-com/augur-api

Version:

TypeScript client library for Augur microservices API endpoints

77 lines 2.09 kB
import { z } from 'zod'; export interface AugurAPIError extends Error { code: string; statusCode: number; service: string; endpoint: string; requestId?: string; validationErrors?: z.ZodError['errors']; } export declare class AugurError extends Error implements AugurAPIError { code: string; statusCode: number; service: string; endpoint: string; requestId?: string; validationErrors?: z.ZodError['errors']; constructor(params: { message: string; code: string; statusCode: number; service: string; endpoint: string; requestId?: string; validationErrors?: z.ZodError['errors']; }); } export declare class ValidationError extends AugurError { constructor(params: { message: string; service: string; endpoint: string; validationErrors: z.ZodError['errors']; }); /** * Format validation errors into human-readable messages * @returns Array of formatted error messages */ getFormattedErrors(): string[]; /** * Get detailed validation error information for debugging * @returns Object with detailed error information */ getDetailedErrors(): Array<{ path: string; message: string; code: string; received?: unknown; expected?: unknown; }>; /** * Override toString to include formatted validation errors * @returns String representation with validation details */ toString(): string; } export declare class AuthenticationError extends AugurError { constructor(params: { message: string; service: string; endpoint: string; }); } export declare class NotFoundError extends AugurError { constructor(params: { message: string; service: string; endpoint: string; }); } export declare class RateLimitError extends AugurError { constructor(params: { message: string; service: string; endpoint: string; }); } //# sourceMappingURL=errors.d.ts.map