@truenas/api-client
    Preparing search index...

    Class TrueNasApiClient<D>Abstract

    Type Parameters

    • D extends ApiDirectoryShape = BaseApiDirectory

      the generated API surface this client is typed against — call, job and event together. Defaults to BaseApiDirectory, the entries identical in every generated version; a version-specific subclass substitutes its own family's surface to reach the methods the shared base cannot include.

    Hierarchy (View Summary)

    Index
    api: TrueNasApi<D>

    API call handler

    authenticator: TrueNasAuthenticator

    Authentication manager

    connection: TrueNasConnection

    WebSocket connection manager

    enabled: boolean

    Initial connection gate, forwarded to the connection. The app flips it later via connection.setEnabled() (mapping its SystemState.Active -> true).

    hostnames: string[]

    System hostnames (primary and fallback)

    logger: Logger

    Logger forwarded to the connection (defaults to a no-op).

    Version-agnostic operation mappings

    Provides a unified interface for operations that differ between API versions. Each version-specific client implements these operations using its own endpoints.

    Usage:

    truenas.ops.containerQuery().subscribe(containers => ...);
    truenas.ops.containerStart(id).subscribe(jobId => ...);
    systemName: string | undefined

    System name (optional)

    uuid: string

    System UUID

    version: ApiVersion

    API version information for this client

    • Factory method to create the API handler. Override in subclasses to provide version-specific API implementations.

      Returns TrueNasApi<D>

    • Factory method to create the authenticator. Override in subclasses to provide version-specific authentication.

      Returns TrueNasAuthenticator

    • Factory method to create the WebSocket connection. Override in subclasses to provide version-specific connection handling.

      Returns TrueNasConnection