UNPKG

@theventures/caret

Version:

Unofficial Node.js API client for the Caret HTTP API

38 lines (37 loc) 1.97 kB
import type { APIErrorData } from "../types/common.js"; export declare class CaretError extends Error { constructor(message: string); } export declare class CaretAPIError extends CaretError { readonly status: number; readonly headers: Record<string, string>; readonly error: APIErrorData; readonly requestId?: string; constructor(status: number, error: APIErrorData, message: string, headers?: Record<string, string>); static generate(status: number, error: APIErrorData, message: string, headers?: Record<string, string>): CaretAPIError; private static getErrorClass; } export declare class BadRequestError extends CaretAPIError { constructor(status: number, error: APIErrorData, message: string, headers?: Record<string, string>); } export declare class AuthenticationError extends CaretAPIError { constructor(status: number, error: APIErrorData, message: string, headers?: Record<string, string>); } export declare class PermissionDeniedError extends CaretAPIError { constructor(status: number, error: APIErrorData, message: string, headers?: Record<string, string>); } export declare class NotFoundError extends CaretAPIError { constructor(status: number, error: APIErrorData, message: string, headers?: Record<string, string>); } export declare class ConflictError extends CaretAPIError { constructor(status: number, error: APIErrorData, message: string, headers?: Record<string, string>); } export declare class UnprocessableEntityError extends CaretAPIError { constructor(status: number, error: APIErrorData, message: string, headers?: Record<string, string>); } export declare class RateLimitError extends CaretAPIError { constructor(status: number, error: APIErrorData, message: string, headers?: Record<string, string>); } export declare class InternalServerError extends CaretAPIError { constructor(status: number, error: APIErrorData, message: string, headers?: Record<string, string>); }