Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • Session

Index

Constructors

constructor

  • new Session(url: string, username: string, password: string): Session

Properties

Optional authCookie

authCookie?: string

cache

cache: { apps: App[] }

Type declaration

Optional url

url?: string

Optional xsrf

xsrf?: string

Methods

fetch

  • fetch(path: string, body?: string, method?: string): Promise<any>
  • Parameters

    • path: string
    • Optional body: string
    • Optional method: string

    Returns Promise<any>

fetchApps

  • fetchApps(): Promise<App[]>

fetchLanguage

  • fetchLanguage(): Promise<string>
  • Fetches the user's preferred language

    Returns Promise<string>

fetchMessage

  • fetchMessage(messageId: number): Promise<Message>
  • Fetches a message from its id

    Parameters

    • messageId: number

      The id of the message

    Returns Promise<Message>

fetchMessages

  • fetchMessages(folder: "Inbox" | "Sent" | "Drafts" | "Trash", page?: number): Promise<Message[]>
  • Fetches a list of messages from the user

    Parameters

    • folder: "Inbox" | "Sent" | "Drafts" | "Trash"

      The system folder to fetch

    • page: number = 0

      The messages page

    Returns Promise<Message[]>

fetchPinnedApps

  • fetchPinnedApps(): Promise<App[]>

fetchUser

  • fetchUser(userId: string): Promise<User>
  • Fetches an ENT user by id

    Parameters

    • userId: string

      The id of the user

    Returns Promise<User>

fetchUserInfo

Private login

  • login(): Promise<void>
  • Fetches a session cookie from the API

    Returns Promise<void>

pinApps

  • pinApps(pins: App[]): Promise<void>
  • Pins a specific array of applications

    Parameters

    • pins: App[]

      The applications to pin

    Returns Promise<void>

searchUsers

sendMessage

  • Sends a message to a list of ENT users and returns the message id

    Parameters

    Returns Promise<number>

setMood

  • setMood(mood: string): Promise<void>

Generated using TypeDoc