APIClient class

Constructors

Properties

socketTimeout: number = 300000

API connection timeout setting

Methods

  • Serialize given command for POST request including connection configuration data

    Parameters

    • cmd: any

      API command to encode

    • secured: boolean = false

    Returns string

    encoded POST data string

  • Get the proxy server configuration

    Returns null | string

    proxy server configuration value or null if not set

  • Get the referer configuration

    Returns null | string

    referer configuration value or null if not set

  • Get the API connection url that is currently set

    Returns string

    API connection url currently in use

  • Get the User Agent

    Returns string

    User Agent string

  • Get the current module version

    Returns string

    module version

  • Perform API login to start session-based communication

    Returns Promise<Response>

    Promise resolving with API Response

  • Perform API logout to close API session in use

    Returns Promise<Response>

    Promise resolving with API Response

  • Perform API request using the given command

    Parameters

    • cmd: any

      API command to request

    • setUserView: boolean = true

    Returns Promise<Response>

    Promise resolving with API Response

  • Request all pages/entries for the given query command

    Parameters

    • cmd: any

      API list command to use

    Returns Promise<Response[]>

    Promise resolving with array of API Responses

  • Request the next page of list entries for the current list query Useful for tables

    Parameters

    • rr: Response

      API Response of current page

    Returns Promise<null | Response>

    Promise resolving with API Response or null in case there are no further list entries

  • Use existing configuration out of ClientRequest session to rebuild and reuse connection settings

    Parameters

    • session: any

      ClientRequest session instance

    Returns APIClient

    Current APIClient instance for method chaining

  • Apply session data (session id and system entity) to given client request session

    Parameters

    • session: any

      ClientRequest session instance

    Returns APIClient

    Current APIClient instance for method chaining

  • Set Credentials to be used for API communication

    Parameters

    • uid: string

      account name

    • pw: string = ""

      account password

    Returns APIClient

    Current APIClient instance for method chaining

  • set custom logger to use instead of default one

    Parameters

    Returns APIClient

    Current APIClient instance for method chaining

  • Set Persistent to request session id for API communication

    Returns APIClient

    Current APIClient instance for method chaining

  • Set the proxy server to use for API communication

    Parameters

    • proxy: string

      proxy server to use for communicatio

    Returns APIClient

    Current APIClient instance for method chaining

  • Set the referer to use for API communication

    Parameters

    • referer: string

      Referer

    Returns APIClient

    Current APIClient instance for method chaining

  • Set Credentials to be used for API communication

    Parameters

    • uid: string

      account name

    • role: string

      role user id

    • pw: string = ""

      role user password

    Returns APIClient

    Current APIClient instance for method chaining

  • Set another connection url to be used for API communication

    Parameters

    • value: string

      API connection url to set

    Returns APIClient

    Current APIClient instance for method chaining

  • Possibility to customize default user agent to fit your needs

    Parameters

    • str: string

      user agent label

    • rv: string

      revision of user agent

    • modules: any = []

      further modules to add to user agent string, format: ["/", "/", ... ]

    Returns APIClient

    Current APIClient instance for method chaining

  • Set a data view to a given subuser

    Parameters

    • uid: string

      subuser account name

    Returns APIClient

    Current APIClient instance for method chaining

  • Activate Default Connection Setup (the default)

    Returns APIClient

    Current APIClient instance for method chaining

  • Set LIVE System for API communication (this is the default setting)

    Returns APIClient

    Current APIClient instance for method chaining