Options
All
  • Public
  • Public/Protected
  • All
Menu

Class ODSConnection

This class represents an session on the ods plattform and enables the access to data provided by the website.

Hierarchy

  • ODSConnection

Index

Constructors

Private constructor

  • You should not create an instance yourself! Use the login methode instead.

    Parameters

    • sessionId: string

    Returns ODSConnection

Properties

Private _cachedGradesPage

_cachedGradesPage: object

Type declaration

cacheTimeout

cacheTimeout: number = 6000000

The cache timeout in milliseconds, please the description in the README

Private sessionId

sessionId: string

The currently used session id to authenticate the user on the webpage

Methods

Private _getGradesPage

  • _getGradesPage(): Promise<string>
  • Gets the html page of the ods overwiev page

    Returns Promise<string>

Private _hasItemInCache

  • _hasItemInCache(item: string): boolean
  • Check wether the item is cached or not.

    Parameters

    • item: string

    Returns boolean

clearCache

  • clearCache(): void
  • Clears the current cache, this will force the next call of one of the three get methodes to pull a new version of the html page.

    Returns void

getGrades

  • getGrades(useCache?: boolean): Promise<GradesEntry[]>
  • Gets the grades (upper table in the overview)

    Parameters

    • Default value useCache: boolean = true

    Returns Promise<GradesEntry[]>

getGradesSummary

  • Gets the grade summary (lower table in the overview)

    Parameters

    • Default value useCache: boolean = true

    Returns Promise<GradesSummaryEntry[]>

getMetaInformation

  • Gets the Meta information available in the ods system

    Parameters

    • Default value useCache: boolean = true

    Returns Promise<MetaInformation>

Static Private _getOwnEndpoint

  • _getOwnEndpoint(): Promise<string>
  • Gets own endpoint (public ip adress of the current used network)

    Returns Promise<string>

Static login

  • login(username: string, password: string): Promise<null | ODSConnection>
  • Tries to login into the ods system with the given credentials. If the login succedes an ODSConnection instance will be returned, null otherwise.

    Parameters

    • username: string
    • password: string

    Returns Promise<null | ODSConnection>

Generated using TypeDoc