Call information of addon

This class is used to get information about the call, the user, the book etc. and to operate with Kitsas Server.

Usually you get an instance of this class in the very first line of the route handlers.

Constructors

Properties

myConnection: KitsasConnectionInterface
request: Request
session: AddonSession

Methods

  • Get the base URL of the service

    Returns string

    Base URL of the service

  • Organization (book) businessId

    Returns string

    businessId of the organization

  • Get connection to Kitsas Server

    Returns KitsasConnectionInterface

    Connection to Kitsas Server

  • Delete notifications

    Parameters

    • Optional category: string

      Category of the notification (optional)

    Returns Promise<void>

  • Get session stored custom data

    Parameters

    • key: string

      Key of the data

    Returns any

    Data or undefined if not found

  • Get the book object to interact with the book

    Returns Promise<KitsasBookInterface>

    Book object

  • Fetch data stored on the server

    Parameters

    • key: string

      key of the data

    Returns Promise<object>

    data value

  • Read the log

    Returns Promise<AddonLogDto[]>

    Log entries

  • Is the addon active i.e. does it have rights

    Returns boolean

    True if the addon is active

  • Get language of the call

    Returns string

    Language code

  • Weite to the log

    Parameters

    • status: LogStatus

      Status of the action

    • message: string

      Log message

    • Optional data: object

      Additional data

    Returns Promise<void>

  • Log information

    Returns {
        organization: string;
        organizationId: string;
        user: string;
        userId: string;
    }

    Log information

    • organization: string
    • organizationId: string
    • user: string
    • userId: string
  • List notifications

    Returns Promise<Notification[]>

    Notifications

  • Add a notify

    Parameters

    • type: NotificationType

      Notification type

    • title: LanguageString

      Title, in languages

    • text: LanguageString

      Text, in languages

    • Optional category: string

      Category of the notification

    Returns Promise<void>

  • Office businessId

    Returns string

    Business id of the office

  • Office type

    Returns OfficeType

    Type of the office

  • Organization (book) Id

    Returns string

    Id of the organization

  • Organization (book) name

    Returns string

    Name of the organization

  • Add or replace notification with same type

    Parameters

    • type: NotificationType

      Notification type

    • title: LanguageString

      Title, in languages

    • text: LanguageString

      Text, in languages

    • category: string

      Category of the notification

    Returns Promise<void>

  • Rights of this sessios

    Returns string[]

    Rights of this session

  • Store data to the server

    Parameters

    • key: string

      key of the data

    • data: object

      data value

    Returns Promise<void>

  • Store custom data to session

    Parameters

    • key: string

      Key of the data

    • value: any

      Data value

    Returns void

  • User rights

    Returns string[]

    Rights of the user