Tela SDK for JavaScript
    Preparing search index...

    Class BaseClientAbstract

    Abstract base HTTP client with retry logic and request/response transformation.

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    baseURL: string
    fetch: typeof fetch
    maxRetries: number
    timeout: number

    Accessors

    • get authToken(): string

      Returns string

    Methods

    • Type Parameters

      • Req

      Parameters

      Returns { req: RequestInit; timeout: number; url: string }

    • Type Parameters

      • Req

      Parameters

      • path: string
      • query: Req | null | undefined

      Returns string

    • Parameters

      • Optionalopts: Record<string, string>

      Returns Headers

    • Parameters

      • url: string
      • _options: RequestInit
      • timeout: number
      • controller: AbortController

      Returns Promise<Response>

    • Returns Record<string, string>

    • Returns string

    post

    • Performs a request and returns the raw Response together with its AbortController, bypassing JSON parsing and case transformation.

      Intended for consumers that parse the response body themselves — e.g. custom Server-Sent Events streams whose framing differs from the chat completion stream handled by Stream.fromSSEResponse. Reuses the client's retry, auth, timeout, and baseURL handling.

      Type Parameters

      • Req

      Parameters

      • method: HTTPMethods

        The HTTP method to use.

      • path: string

        Request path (relative to baseURL/opts.baseURL, or absolute).

      • Optionalopts: RequestOptions<Req>

        Request options (notably baseURL, query, and signal).

      Returns Promise<{ controller: AbortController; response: Response }>

      The live Response and the AbortController controlling it.

    • Parameters

      • query: Record<string, unknown>

      Returns string