Home Reference Source
import {Magister} from 'magister.js/src/magister.js'
public class | source

Magister

Class to communicate with Magister.

Member Summary

Public Members
public

http: Http

public
public
public get

Method Summary

Public Methods
public
public

appointments(from: Date, to: Date, options: Object): Promise<Appointment[]>

public
public
public
public
public
public

async login(forceLogin: Boolean): Promise<String>

Logins to Magister.

public
public

persons(query: String, type: String): Promise<Person[]>

public

Public Members

public http: Http source

public profileInfo: ProfileInfo source

public school: School source

public get token: String source

Public Methods

public activities(): Promise<Activity[]> source

Return:

Promise<Activity[]>

public appointments(from: Date, to: Date, options: Object): Promise<Appointment[]> source

Params:

NameTypeAttributeDescription
from Date

Time is ignored.

to Date
  • optional
  • default: from

Time is ignored

options Object
  • optional
  • default: {}
options.fillPersons Boolean
  • optional
  • default: false
options.fetchAbsences Boolean
  • optional
  • default: true
options.ignoreAbsenceErrors Boolean
  • optional
  • default: true

Return:

Promise<Appointment[]>

public assignments(options: Object): Promise<Assignment[]> source

Params:

NameTypeAttributeDescription
options Object
  • optional
  • default: {}
options.count Number
  • optional
  • default: 50
options.skip Number
  • optional
  • default: 0
options.fillPersons Boolean
  • optional
  • default: false

Return:

Promise<Assignment[]>

public children(): Promise<Magister[]> source

Return:

Promise<Magister[]>

public courses(): Promise<Course[]> source

Return:

Promise<Course[]>

public createAppointment(options: Object): Promise source

Params:

NameTypeAttributeDescription
options Object
options.description String

The description of the appointment.

options.start Date

The start of the appointment, time is ignored when options.fullDay is set to true.

options.end Date

The end of the appointment, this is ignored when options.fullDay is set to true.

options.fullDay Boolean
  • optional
  • default: false

When this is true, options.end is ignored and only options.start is used to set the begin and the end for the appointment.

options.location String
  • optional

The location (classroom for example) for the appointment.

options.content String
  • optional

Some arbitrary string you want to save.

options.type Number
  • optional
  • default: 1

The type of the appointment: 1 for personal or 16 for planning

Return:

Promise

public fileFolders(): Promise<FileFolder[]> source

Return:

Promise<FileFolder[]>

public async login(forceLogin: Boolean): Promise<String> source

Logins to Magister.

Params:

NameTypeAttributeDescription
forceLogin Boolean
  • optional
  • default: false

Force a login, even when a token is in the options object.

Return:

Promise<String>

A promise that resolves when done logging in. With the current session ID as parameter.

public messageFolders(): Promise<MessageFolder[]> source

Return:

Promise<MessageFolder[]>

public persons(query: String, type: String): Promise<Person[]> source

Params:

NameTypeAttributeDescription
query String
type String
  • optional

Return:

Promise<Person[]>

public schoolUtilities(): Promise<SchoolUtility[]> source

Return:

Promise<SchoolUtility[]>