Class WebUntisQR

Hierarchy (view full)

Constructors

  • Use the data you get from a WebUntis QR code

    Parameters

    • QRCodeURI: string

      A WebUntis uri. This is the data you get from the QR Code from the webuntis webapp under profile->Data access->Display

    • Optional identity: string

      A identity like: MyAwesomeApp

    • authenticator: Authenticator<AuthenticatorOptions<string>>

      Custom otplib v12 instance. Default will use the default otplib configuration.

    • Optional URL: typeof URL

      Custom whatwg url implementation. Default will use the nodejs implementation.

    • Optional disableUserAgent: boolean = false

      If this is true, axios will not send a custom User-Agent

    Returns WebUntisQR

Properties

anonymous: boolean
axios: AxiosInstance
baseurl: string
cookies: string[]
id: string
password: string
school: string
schoolbase64: string
sessionInformation: null | SessionInformation
username: string
TYPES: typeof WebUntisElementType = WebUntisElementType

Methods

  • Private

    Parameters

    • Optional setCookieArray: string[]
    • Optional cookieName: string = 'JSESSIONID'

    Returns undefined | string

  • Private

    Get JWT Token

    Parameters

    • validateSession: boolean = true

    Returns Promise<string>

  • Parameters

    • token: string | number
    • username: string
    • time: number
    • skipSessionInfo: boolean = false

    Returns Promise<SessionInformation>

  • Private

    Make a JSON RPC Request with the current session

    Type Parameters

    • Response = Record<string, any>

    Parameters

    • method: string
    • Optional parameter: Record<string, any> = {}
    • Optional validateSession: boolean = true

      Whether the session should be checked first

    • Optional url: string = ...

    Returns Promise<Response>

  • Returns all the Lessons where you were absent including the excused one!

    Parameters

    • rangeStart: Date
    • rangeEnd: Date
    • Optional excuseStatusId: number = -1
    • Optional validateSession: boolean = true

    Returns Promise<Absences>

  • Get all classes known by WebUntis

    Parameters

    • Optional validateSession: boolean = true
    • schoolyearId: number

    Returns Promise<Klasse[]>

  • Get Exams for range

    Parameters

    • rangeStart: Date
    • rangeEnd: Date
    • klasseId: number = -1
    • withGrades: boolean = false
    • Optional validateSession: boolean = true

    Returns Promise<Exam[]>

  • TODO: Find out what type this function returns

    Parameters

    • rangeStart: Date
    • rangeEnd: Date
    • Optional validateSession: boolean = true

    Returns Promise<any[]>

  • Get the time when WebUntis last changed its data

    Parameters

    • Optional validateSession: boolean = true

    Returns Promise<number>

  • Get the Timetable of your class for the given day Note: You can't use this with anonymous login

    Parameters

    • date: Date
    • Optional validateSession: boolean = true

    Returns Promise<Lesson[]>

  • Get the Timetable of your class for a given Date range Note: You can't use this with anonymous login

    Parameters

    • rangeStart: Date
    • rangeEnd: Date
    • Optional validateSession: boolean = true

    Returns Promise<Lesson[]>

  • Get your own Timetable for the given day Note: You can't use this with anonymous login

    Parameters

    • date: Date
    • Optional validateSession: boolean = true

    Returns Promise<Lesson[]>

  • Get your own timetable for a given Date range Note: You can't use this with anonymous login

    Parameters

    • rangeStart: Date
    • rangeEnd: Date
    • Optional validateSession: boolean = true

    Returns Promise<Lesson[]>

  • Get the timetable for the current week for the current element from the web client API.

    Parameters

    • date: Date

      one date in the week to query

    • Optional formatId: number = 1

      set to 1 to include teachers, 2 omits the teachers in elements response

    • Optional validateSession: boolean = true

    Returns Promise<WebAPITimetable[]>

  • Returns a URL to a unique PDF of all the lessons you were absent

    Parameters

    • rangeStart: Date
    • rangeEnd: Date
    • Optional validateSession: boolean = true
    • Optional excuseStatusId: number = -1
    • Optional lateness: boolean = true
    • Optional absences: boolean = true
    • Optional excuseGroup: number = 2

    Returns Promise<string>

  • Get the timetable for a specific day for a specific element.

    Parameters

    • date: Date
    • id: number
    • type: number
    • Optional validateSession: boolean = true

    Returns Promise<Lesson[]>

  • Get the timetable for a given Date range for specific element

    Parameters

    • rangeStart: Date
    • rangeEnd: Date
    • id: number
    • type: number
    • Optional validateSession: boolean = true

    Returns Promise<Lesson[]>

  • Get the timetable for the current week for a specific element from the web client API.

    Parameters

    • date: Date

      one date in the week to query

    • id: number

      element id

    • type: number

      element type

    • Optional formatId: number = 1

      set to 1 to include teachers, 2 omits the teachers in elements response

    • Optional validateSession: boolean = true

    Returns Promise<WebAPITimetable[]>

  • Login with your credentials

    Notice: The server may revoke this session after less than 10min of idle.

    Untis says in the official docs:

    An application should always log out as soon as possible to free system resources on the server.

    Returns Promise<SessionInformation>

  • Converts the untis date string format to a normal JS Date object

    Parameters

    • date: string

      Untis date string

    • Optional baseDate: Date = ...

      Base date. Default beginning of current day

    Returns Date

    Static

  • Convert a untis time string to a JS Date object

    Parameters

    • time: string | number

      Untis time string

    • Optional baseDate: Date = ...

      Day used as base for the time. Default: Current date

    Returns Date

    Static

Generated using TypeDoc