Options
All
  • Public
  • Public/Protected
  • All
Menu

Class LucidAPI

Lucid API wrapper

Hierarchy

  • LucidAPI

Index

Constructors

constructor

  • new LucidAPI(_LUCID_API_ENDPOINT?: string, _LUCID_JWT?: undefined | string): LucidAPI
  • Parameters

    • Default value _LUCID_API_ENDPOINT: string = "http://localhost:7090"

      Lucid API endpoint

    • Optional _LUCID_JWT: undefined | string

    Returns LucidAPI

Properties

Protected _LUCID_API_ENDPOINT

_LUCID_API_ENDPOINT: string

Lucid API endpoint

Protected _LUCID_ENDPOINT_VERSION

_LUCID_ENDPOINT_VERSION: string

Lucid endpoint version

Protected Optional _LUCID_JWT

_LUCID_JWT: undefined | string

Protected _LUCID_KV_ENDPOINT

_LUCID_KV_ENDPOINT: string

Lucid KV endpoint

Protected _LUCID_UI_ENDPOINT

_LUCID_UI_ENDPOINT: string

Lucid UI endpoint

Protected isInstanceInitialized

isInstanceInitialized: boolean = false

Was the LucidAPI object initialized

Accessors

LUCID_API_ENDPOINT

  • get LUCID_API_ENDPOINT(): string
  • Lucid API endpoint

    Returns string

LUCID_ENDPOINT_VERSION

  • get LUCID_ENDPOINT_VERSION(): string
  • Lucid endpoint version

    Returns string

LUCID_KV_ENDPOINT

  • get LUCID_KV_ENDPOINT(): string
  • Lucid KV endpoint

    Returns string

LUCID_UI_ENDPOINT

  • get LUCID_UI_ENDPOINT(): string
  • Lucid UI endpoint

    Returns string

Methods

deleteKey

  • deleteKey(key: string): Promise<Response>

existsKey

  • existsKey(key: string): Promise<Response>

getKey

  • getKey(key: string): Promise<Response>

init

  • init(): Promise<string>
  • Initialize the Lucid API wrapper instance.

    Checks the Lucid API endpoint is valid and get its version.

    Checks the Lucid API endpoint authentification JSON Web Token if it was provided.

    throws

    {Error} Instance already initialized - Invalid endpoint - Invalid JWT

    Returns Promise<string>

    Lucid API endpoint version

lucidApiCall

  • lucidApiCall(key: string, method?: string, body?: undefined | string, headers?: object): Promise<Response>
  • Call the Lucid API

    throws

    {Error} Not logged in - GET, DELETE, HEAD with body - Missing PUT body - Request error

    Parameters

    • key: string

      Targetted key

    • Default value method: string = "GET"

      HTTP method

    • Optional body: undefined | string

      Request body

    • Default value headers: object = {}

      Headers to add to the request

    Returns Promise<Response>

    Request response

storeKeyDataAny

  • storeKeyDataAny(key: string, data: any): Promise<Response>

storeKeyDataJson

  • storeKeyDataJson(key: string, obj: __type): Promise<Response>

Generated using TypeDoc