Class Client

Class used to communicate with a CubicWeb instance's API.

Hierarchy

  • Client

Constructors

Methods

Constructors

  • Class used to communicate with a CubicWeb instance's API.

    Parameters

    Returns Client

Methods

  • Executes the given query and waits for the response.

    Returns

    A promise with the request's result set

    Parameters

    • query: string

      The RQL query to send

    • params: RQLParams = {}

      The additional parameters for the request

    Returns Promise<ResultSet>

  • Tries to log in the user on the configured CubicWeb instance with the given credentials.

    Returns

    A promise returning true if the login was successful, false otherwise

    Parameters

    • login: string

      The user login

    • password: string

      THe user password

    Returns Promise<boolean>

  • Creates a new transaction and exposes the Transaction object in the given callback. Use this callback to execute RQL requests as part of the transaction. Once the callback's end is reached, the transaction is automatically committed.

    Returns

    The promise returned by the callback

    Type Parameters

    • T

    Parameters

    • callback: ((tr: Transaction) => Promise<T>)

      Function to execute transaction requests in.

    Returns Promise<T>

Generated using TypeDoc