Options
All
  • Public
  • Public/Protected
  • All
Menu

Class CatavoltApiImpl

Top-level entry point into the Catavolt API

Hierarchy

  • CatavoltApiImpl

Implements

Index

Constructors

Private constructor

  • new CatavoltApiImpl(serverUrl: string, serverVersion: string): CatavoltApiImpl
  • Construct an CatavoltApiImpl This should not be called directly, instead use the 'singleton' method

    Parameters

    • serverUrl: string
    • serverVersion: string

    Returns CatavoltApiImpl

Properties

DEFAULT_LOCALE

DEFAULT_LOCALE: CvLocale = new CvLocale('en')

Private _devicePropsDynamic

_devicePropsDynamic: object

Type declaration

  • [index: string]: function
      • (): string
      • Returns string

Private _devicePropsStatic

_devicePropsStatic: object

Type declaration

  • [index: string]: string

Private _dialogApi

_dialogApi: DialogApi

Private _locale

_locale: CvLocale = null

Private _session

_session: Session

dataLastChangedTime

dataLastChangedTime: Date = new Date(0)

Static Private ONE_HOUR_IN_MILLIS

ONE_HOUR_IN_MILLIS: number = 60 * 60 * 1000

Static Private SERVER_URL

SERVER_URL: string = "https://dialog.hxgn-api.net"

Static Private SERVER_VERSION

SERVER_VERSION: string = "v0"

Static Private _singleton

_singleton: CatavoltApiImpl

Accessors

clientTimeoutMillis

  • get clientTimeoutMillis(): number
  • Get the number of millis that the client will remain active between calls to the server.

    Returns number

currencySymbol

  • get currencySymbol(): string
  • Get the currency symbol override if defined from the server.

    Returns string

deviceProps

  • get deviceProps(): object
  • Get the device props

    Returns object

    • [index: string]: string

dialogApi

  • Get the DialogApi instance

    Returns DialogApi

isLoggedIn

  • get isLoggedIn(): boolean
  • Checked logged in status

    Returns boolean

locale

  • Get the preferred locale

    Returns CvLocale

  • Get the preferred locale

    Parameters

    Returns void

remainingSessionTime

  • get remainingSessionTime(): number
  • Time remaining before this session is expired by the server

    Returns number

session

  • Get the Session

    Returns Session

sessionHasExpired

  • get sessionHasExpired(): boolean
  • Return whether or not the session has expired

    Returns boolean

Static defaultTTLInMillis

  • get defaultTTLInMillis(): number
  • Get the default session time

    Returns number

Static singleton

  • Get the singleton instance of the CatavoltApiImpl

    Returns CatavoltApiImpl

Methods

addDynamicDeviceProp

  • addDynamicDeviceProp(propName: string, propFn: function): void
  • Add or replace a dynamic device property (func)

    Parameters

    • propName: string
    • propFn: function
        • (): string
        • Returns string

    Returns void

addStaticDeviceProp

  • addStaticDeviceProp(propName: string, propValue: string): void
  • Add or replace a static device property

    Parameters

    • propName: string
    • propValue: string

    Returns void

changePasswordAndLogin

  • changePasswordAndLogin(tenantId: string, clientType: ClientType, userId: string, existingPassword: string, newPassword: string): Promise<Session | Redirection>

getRedirection

  • getRedirection(redirectionId: string): Promise<Redirection>

initDialogApi

  • initDialogApi(serverUrl: string, serverVersion?: string): void
  • Initialize a dialog service implementation for use by this CatavoltApiImpl

    Parameters

    • serverUrl: string
    • Default value serverVersion: string = CatavoltApiImpl.SERVER_VERSION

    Returns void

isFeatureSetAvailable

  • isFeatureSetAvailable(featureSet: FeatureSet): boolean

login

  • Log in and retrieve the Session

    Parameters

    • tenantId: string
    • clientType: ClientType
    • userId: string
    • password: string

    Returns Promise<Session | Redirection>

logout

  • logout(): Promise<object>
  • Logout and destroy the session

    Returns Promise<object>

openDialog

openDialogWithId

  • openDialogWithId(dialogId: string): Promise<Dialog>

openStream

performWorkbenchAction

performWorkbenchActionForId

  • performWorkbenchActionForId(workbenchId: string, workbenchActionId: string): Promise<Redirection>

Private processLogin

  • Parameters

    • tenantId: string
    • clientType: ClientType
    • userId: string
    • password: string

    Returns Promise<Session | Redirection>

refreshSession

  • refreshSession(tenantId: string, sessionId: string): Promise<Session>
  • Refresh the CatavoltApiImpl

    Parameters

    • tenantId: string
    • sessionId: string

    Returns Promise<Session>

streamContent

toDialogOrRedirection

Generated using TypeDoc