Class Client

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

Hierarchy

  • Client

Constructors

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

    Parameters

    Returns Client

Methods

  • Get the user associated to this client

    Returns Promise<CurrentUser>

    A promise resolving to the current user

  • Executes the given query and waits for the response.

    If binaries are given, the request is automatically sent using multipart/form-data to allow uploading binaries.

    Parameters

    • rql: string

      The RQL query to send

    • params: RQLQueryParams = {}

      The additional parameters for the request

    Returns Promise<ResultSet<readonly ResultSetCell[]>>

    A promise with the request's result set

  • Executes the given transaction.

    If the Transaction object contains binaries, the request is automatically sent using multipart/form-data to allow uploading binaries.

    Parameters

    Returns Promise<TransactionResult>

    A promise returning the transaction result on success

  • Get the binary for the given entity attribute

    Parameters

    • eid: number

      Entity eid to fetch the binary from

    • attribute: string

      Attribute on the entity in which the binary is stored

    Returns Promise<Blob>

    A promise resolving to the binary as a Blob

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

    Parameters

    • login: string

      The user login

    • password: string

      The user password

    Returns Promise<boolean>

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

  • Logs out the current user. Will invalidate any authentication cookie active.

    Returns Promise<void>

    A promise which will resolve when the user is properly logged out

Generated using TypeDoc