@mxraven/admin - v2.1.0
    Preparing search index...

    Class AdminClient

    Client for the mxRaven control-plane v2 REST API.

    Construct one with a ZITADEL-issued bearer access token, then reach resource families through a Workspace. Public operations, such as the tenant login context, work with a blank token.

    The client is safe for concurrent use. Every network operation accepts an AbortSignal so callers can cancel it.

    const admin = new AdminClient({ token: process.env.MXRAVEN_TOKEN });
    for await (const domain of admin.workspace("my-workspace").domains().list()) {
    console.log(domain.domainName, domain.status);
    }
    Index
    apiVersion: string

    The API version prefix applied to every request path.

    baseUrl: string

    The control-plane base URL, without a trailing slash.

    rateLimit: RateLimitConfig

    The client-wide rate-limit behaviour.

    defaultApiVersion: "v2"

    The default control-plane API version prefix.

    defaultBaseUrl: "https://api.mxraven.com"

    The default mxRaven control-plane base URL.

    • get token(): string

      The bearer token in use, or an empty string.

      Returns string

    • The public tenant-context family. Works with a blank token.

      Returns AuthClient

      A client for the public authentication family.

    • Issues a DELETE request.

      Parameters

      • path: string

        A client-relative path; the API version is prepended.

      • Optionaloptions: RequestOptions

        Optional cancellation signal.

      Returns Promise<Response>

      The decoded response.

      ApiException When the control plane returns a non-success status.

    • Issues a GET request.

      Parameters

      • path: string

        A client-relative path; the API version is prepended.

      • Optionalquery: Readonly<Record<string, string | number | boolean | undefined>>

        Optional query parameters.

      • Optionaloptions: RequestOptions

        Optional cancellation signal.

      Returns Promise<Response>

      The decoded response.

      ApiException When the control plane returns a non-success status.

    • Issues a GET and wraps the response in a lazily auto-paginating Paged. Subsequent pages are fetched by re-issuing the same request with the next page_token, only as the async iterator advances.

      Type Parameters

      • T

        The element type.

      Parameters

      • path: string

        A client-relative path; the API version is prepended.

      • Optionalquery: Readonly<Record<string, string | number | boolean | undefined>>

        Optional query parameters.

      • Optionaloptions: RequestOptions

        Optional cancellation signal.

      Returns Promise<Paged<T>>

      A lazily paginating collection over the response items.

      ApiException When the control plane returns a non-success status.

    post

    • post(path: string, body: unknown, options?: RequestOptions): Promise<Response>

      Issues a POST request with a JSON body.

      Parameters

      • path: string

        A client-relative path; the API version is prepended.

      • body: unknown

        The request body, serialized as JSON.

      • Optionaloptions: RequestOptions

        Optional cancellation signal.

      Returns Promise<Response>

      The decoded response.

      ApiException When the control plane returns a non-success status.

    • Issues a PUT request with a JSON body.

      Parameters

      • path: string

        A client-relative path; the API version is prepended.

      • body: unknown

        The request body, serialized as JSON.

      • Optionaloptions: RequestOptions

        Optional cancellation signal.

      Returns Promise<Response>

      The decoded response.

      ApiException When the control plane returns a non-success status.

    • Sends a request to the control plane.

      A non-success status is decoded as an RFC 9457 problem and thrown as an ApiException. GET and DELETE requests are retried on 429 according to AdminClient.rateLimit; POST and PUT are not.

      Parameters

      • method: string

        The HTTP method.

      • path: string

        A client-relative path; the API version is prepended.

      • Optionalquery: Readonly<Record<string, string | number | boolean | undefined>>

        Optional query parameters.

      • Optionalbody: unknown

        The request body, serialized as JSON, or undefined for none.

      • options: RequestOptions = {}

        Optional cancellation signal.

      Returns Promise<Response>

      The decoded response.

      ApiException When the control plane returns a non-success status.

    • Binds a tenant. The returned Workspace exposes every tenant-scoped resource family without repeating the slug.

      Parameters

      • tenantSlug: string

        The tenant slug to bind.

      Returns Workspace

      A workspace bound to the given tenant.