From e6f32f3ca4a84d9619d8b43052090e32c0a3641c Mon Sep 17 00:00:00 2001 From: high5-bot Date: Sat, 6 Apr 2024 22:33:14 +0000 Subject: [PATCH] docs: update documentation --- dist/webuntis.js | 23 +++--- dist/webuntis.js.map | 2 +- dist/webuntis.mjs | 5 +- dist/webuntis.mjs.map | 2 +- docs/classes/InternalWebuntisSecretLogin.html | 80 +++++++++---------- docs/classes/WebUntis.html | 80 +++++++++---------- docs/classes/WebUntisAnonymousAuth.html | 80 +++++++++---------- docs/classes/WebUntisQR.html | 80 +++++++++---------- docs/classes/WebUntisSecretAuth.html | 80 +++++++++---------- docs/enums/WebUntisDay.html | 4 +- docs/enums/WebUntisElementType.html | 4 +- docs/interfaces/Absence.html | 4 +- docs/interfaces/Absences.html | 4 +- docs/interfaces/CodesEntity.html | 4 +- docs/interfaces/ColorEntity.html | 4 +- docs/interfaces/Department.html | 4 +- docs/interfaces/Exam.html | 4 +- docs/interfaces/Excuse.html | 4 +- docs/interfaces/Holiday.html | 4 +- docs/interfaces/Homework.html | 4 +- docs/interfaces/Inbox.html | 4 +- docs/interfaces/Inboxmessage.html | 4 +- docs/interfaces/Klasse.html | 4 +- docs/interfaces/Lesson.html | 4 +- docs/interfaces/LsEntity.html | 4 +- docs/interfaces/MessagesOfDay.html | 4 +- docs/interfaces/Messagesender.html | 4 +- docs/interfaces/NewsWidget.html | 6 +- docs/interfaces/Room.html | 4 +- docs/interfaces/SchoolYear.html | 4 +- docs/interfaces/ShortData.html | 4 +- docs/interfaces/StatusData.html | 4 +- docs/interfaces/Student.html | 4 +- docs/interfaces/Subject.html | 4 +- docs/interfaces/Teacher.html | 4 +- docs/interfaces/TimeUnit.html | 4 +- docs/interfaces/Timegrid.html | 4 +- docs/interfaces/WebAPITimetable.html | 4 +- docs/interfaces/WebElement.html | 4 +- docs/interfaces/WebElementData.html | 4 +- docs/types/Authenticator.html | 2 +- docs/types/URLClass.html | 2 +- 42 files changed, 284 insertions(+), 278 deletions(-) diff --git a/dist/webuntis.js b/dist/webuntis.js index 47b4eaf..bc26cb4 100644 --- a/dist/webuntis.js +++ b/dist/webuntis.js @@ -94,6 +94,9 @@ var __publicField$1 = (obj, key, value) => { __defNormalProp$1(obj, typeof key !== "symbol" ? key + "" : key, value); return value; }; +const parse = (dateStr, formatStr, referenceDate, options) => { + return dateFns.parse(`${dateStr}`, formatStr, referenceDate, options); +}; const _Base = class _Base { /** * @@ -207,8 +210,8 @@ const _Base = class _Base { async getLatestSchoolyear(validateSession = true) { const data = await this._request("getSchoolyears", {}, validateSession); data.sort((a, b) => { - const na = dateFns.parse(a.startDate, "yyyyMMdd", /* @__PURE__ */ new Date()); - const nb = dateFns.parse(b.startDate, "yyyyMMdd", /* @__PURE__ */ new Date()); + const na = parse(a.startDate, "yyyyMMdd", /* @__PURE__ */ new Date()); + const nb = parse(b.startDate, "yyyyMMdd", /* @__PURE__ */ new Date()); return nb.getTime() - na.getTime(); }); if (!data[0]) @@ -216,8 +219,8 @@ const _Base = class _Base { return { name: data[0].name, id: data[0].id, - startDate: dateFns.parse(data[0].startDate, "yyyyMMdd", /* @__PURE__ */ new Date()), - endDate: dateFns.parse(data[0].endDate, "yyyyMMdd", /* @__PURE__ */ new Date()) + startDate: parse(data[0].startDate, "yyyyMMdd", /* @__PURE__ */ new Date()), + endDate: parse(data[0].endDate, "yyyyMMdd", /* @__PURE__ */ new Date()) }; } /** @@ -227,8 +230,8 @@ const _Base = class _Base { async getSchoolyears(validateSession = true) { const data = await this._request("getSchoolyears", {}, validateSession); data.sort((a, b) => { - const na = dateFns.parse(a.startDate, "yyyyMMdd", /* @__PURE__ */ new Date()); - const nb = dateFns.parse(b.startDate, "yyyyMMdd", /* @__PURE__ */ new Date()); + const na = parse(a.startDate, "yyyyMMdd", /* @__PURE__ */ new Date()); + const nb = parse(b.startDate, "yyyyMMdd", /* @__PURE__ */ new Date()); return nb.getTime() - na.getTime(); }); if (!data[0]) @@ -237,8 +240,8 @@ const _Base = class _Base { return { name: year.name, id: year.id, - startDate: dateFns.parse(year.startDate, "yyyyMMdd", /* @__PURE__ */ new Date()), - endDate: dateFns.parse(year.endDate, "yyyyMMdd", /* @__PURE__ */ new Date()) + startDate: parse(year.startDate, "yyyyMMdd", /* @__PURE__ */ new Date()), + endDate: parse(year.endDate, "yyyyMMdd", /* @__PURE__ */ new Date()) }; }); } @@ -550,7 +553,7 @@ const _Base = class _Base { static convertUntisDate(date, baseDate = dateFns.startOfDay(/* @__PURE__ */ new Date())) { if (typeof date !== "string") date = `${date}`; - return dateFns.parse(date, "yyyyMMdd", baseDate); + return parse(date, "yyyyMMdd", baseDate); } /** * Convert a untis time string to a JS Date object @@ -561,7 +564,7 @@ const _Base = class _Base { static convertUntisTime(time, baseDate = /* @__PURE__ */ new Date()) { if (typeof time !== "string") time = `${time}`; - return dateFns.parse(time.padStart(4, "0"), "Hmm", baseDate); + return parse(time.padStart(4, "0"), "Hmm", baseDate); } /** * Get all known Subjects for the current logged-in user diff --git a/dist/webuntis.js.map b/dist/webuntis.js.map index d12fc44..89ecbad 100644 --- a/dist/webuntis.js.map +++ b/dist/webuntis.js.map @@ -1 +1 @@ -{"version":3,"file":"webuntis.js","sources":["../src/cookie.ts","../src/base-64.ts","../src/types.ts","../src/base.ts","../src/secret.ts","../src/qr.ts","../src/anonymous.ts"],"sourcesContent":["/**\n * Shamelessly stolen from @tinyhttp/cookie.\n *\n * Because @tinyhttp/cookie doesn't provide a commonjs build, I just decided to include the source code.\n * We need a cjs build, because we generate both esm and cjs.\n */\n\nconst pairSplitRegExp = /; */;\n\n/**\n * RegExp to match field-content in RFC 7230 sec 3.2\n *\n * field-content = field-vchar [ 1*( SP / HTAB ) field-vchar ]\n * field-vchar = VCHAR / obs-text\n * obs-text = %x80-FF\n */\n\n// eslint-disable-next-line no-control-regex\nconst fieldContentRegExp = /^[\\u0009\\u0020-\\u007e\\u0080-\\u00ff]+$/;\n\nfunction tryDecode(str: string, decode: (str: string) => string) {\n try {\n return decode(str);\n } catch (e) {\n return str;\n }\n}\n\n/**\n * Parse a cookie header.\n *\n * Parse the given cookie header string into an object\n * The object has the various cookies as keys(names) => values\n *\n */\nexport function parse(\n str: string,\n options: {\n decode: (str: string) => string;\n } = {\n decode: decodeURIComponent,\n },\n): Record {\n const obj: Record = {};\n const pairs = str.split(pairSplitRegExp);\n\n for (const pair of pairs) {\n let eqIdx = pair.indexOf('=');\n\n // skip things that don't look like key=value\n if (eqIdx < 0) continue;\n\n const key = pair.substr(0, eqIdx).trim();\n let val = pair.substr(++eqIdx, pair.length).trim();\n\n // quoted values\n if ('\"' == val[0]) val = val.slice(1, -1);\n\n // only assign once\n if (obj[key] == null) obj[key] = tryDecode(val, options.decode);\n }\n\n return obj;\n}\n\nexport type SerializeOptions = Partial<{\n encode: (str: string) => string;\n maxAge: number;\n domain: string;\n path: string;\n httpOnly: boolean;\n secure: boolean;\n sameSite: boolean | 'Strict' | 'strict' | 'Lax' | 'lax' | 'None' | 'none' | string;\n expires: Date;\n}>;\n\nexport function serialize(name: string, val: string, opt: SerializeOptions = {}): string {\n if (!opt.encode) opt.encode = encodeURIComponent;\n\n if (!fieldContentRegExp.test(name)) throw new TypeError('argument name is invalid');\n\n const value = opt.encode(val);\n\n if (value && !fieldContentRegExp.test(value)) throw new TypeError('argument val is invalid');\n\n let str = name + '=' + value;\n\n if (null != opt.maxAge) {\n const maxAge = opt.maxAge - 0;\n\n if (isNaN(maxAge) || !isFinite(maxAge)) throw new TypeError('option maxAge is invalid');\n\n str += '; Max-Age=' + Math.floor(maxAge);\n }\n\n if (opt.domain) {\n if (!fieldContentRegExp.test(opt.domain)) throw new TypeError('option domain is invalid');\n\n str += '; Domain=' + opt.domain;\n }\n\n if (opt.path) {\n if (!fieldContentRegExp.test(opt.path)) throw new TypeError('option path is invalid');\n\n str += '; Path=' + opt.path;\n }\n\n if (opt.expires) str += '; Expires=' + opt.expires.toUTCString();\n\n if (opt.httpOnly) str += '; HttpOnly';\n\n if (opt.secure) str += '; Secure';\n\n if (opt.sameSite) {\n const sameSite = typeof opt.sameSite === 'string' ? opt.sameSite.toLowerCase() : opt.sameSite;\n\n switch (sameSite) {\n case true:\n case 'strict':\n str += '; SameSite=Strict';\n break;\n case 'lax':\n str += '; SameSite=Lax';\n break;\n case 'none':\n str += '; SameSite=None';\n break;\n default:\n throw new TypeError('option sameSite is invalid');\n }\n }\n\n return str;\n}\n","const chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';\nexport function btoa(input = '') {\n let str = input;\n let output = '';\n\n for (\n let block = 0, charCode, i = 0, map = chars;\n str.charAt(i | 0) || ((map = '='), i % 1);\n output += map.charAt(63 & (block >> (8 - (i % 1) * 8)))\n ) {\n charCode = str.charCodeAt((i += 3 / 4));\n\n if (charCode > 0xff) {\n throw new Error(\"'btoa' failed: The string to be encoded contains characters outside of the Latin1 range.\");\n }\n\n block = (block << 8) | charCode;\n }\n\n return output;\n}\n","export interface SchoolYear {\n name: string;\n id: number;\n startDate: Date;\n endDate: Date;\n}\n\nexport interface MessagesOfDay {\n id: number;\n subject: string;\n text: string;\n isExpanded: boolean;\n /**\n * Unknown type. I have never seen this in use.\n */\n attachments: any[];\n}\n\nexport interface NewsWidget {\n /**\n * Unknown type. I have never seen this in use.\n */\n systemMessage: any;\n messagesOfDay: MessagesOfDay[];\n rssUrl: string;\n}\n\nexport interface Messagesender {\n userId: number;\n displayName: string;\n imageUrl: string;\n className: string;\n}\n\nexport interface Inboxmessage {\n allowMessageDeletion: boolean;\n contentPreview: string;\n hasAttachments: boolean;\n id: number;\n isMessageRead: boolean;\n isReply: boolean;\n isReplyAllowed: boolean;\n sender: Messagesender;\n sentDateTime: string;\n subject: string;\n}\n\nexport interface Inbox {\n incomingMessages: Inboxmessage[];\n}\n\nexport interface ShortData {\n id: number;\n name: string;\n longname: string;\n orgname?: string;\n orgid?: number;\n}\n\nexport interface Lesson {\n id: number;\n date: number;\n startTime: number;\n endTime: number;\n kl: ShortData[];\n te: ShortData[];\n su: ShortData[];\n ro: ShortData[];\n lstext?: string;\n lsnumber: number;\n activityType?: 'Unterricht' | string;\n code?: 'cancelled' | 'irregular';\n info?: string;\n substText?: string;\n statflags?: string;\n sg?: string;\n bkRemark?: string;\n bkText?: string;\n}\n\nexport interface Homework {\n /**\n * Unknown type. I have never seen this in use.\n */\n attachments: Array;\n completed: boolean;\n date: number;\n dueDate: number;\n id: number;\n lessonId: number;\n remark: string;\n text: string;\n}\n\nexport interface Subject {\n id: number;\n name: string;\n longName: string;\n alternateName: string | '';\n active: boolean;\n foreColor: string;\n backColor: string;\n}\n\nexport enum WebUntisDay {\n Sunday = 1,\n Monday = 2,\n Tuesday = 3,\n Wednesday = 4,\n Thursday = 5,\n Friday = 6,\n Saturday = 7,\n}\n\nexport interface TimeUnit {\n name: string;\n startTime: number;\n endTime: number;\n}\n\nexport interface Timegrid {\n day: WebUntisDay;\n timeUnits: TimeUnit[];\n}\n\nexport interface Exam {\n id: number;\n examType: string;\n name: string;\n studentClass: string[];\n assignedStudents: {\n klasse: { id: number; name: string };\n displayName: string;\n id: number;\n }[];\n examDate: number;\n startTime: number;\n endTime: number;\n subject: string;\n teachers: string[];\n rooms: string[];\n text: string;\n grade?: string;\n}\n\nexport enum WebUntisElementType {\n CLASS = 1,\n TEACHER = 2,\n SUBJECT = 3,\n ROOM = 4,\n STUDENT = 5,\n}\n\nexport interface WebElement {\n type: WebUntisElementType;\n id: number;\n orgId: number;\n missing: boolean;\n state: 'REGULAR' | 'ABSENT' | 'SUBSTITUTED';\n}\n\nexport interface WebElementData extends WebElement {\n element: {\n type: number;\n id: number;\n name: string;\n longName?: string;\n displayname?: string;\n alternatename?: string;\n canViewTimetable: boolean;\n externalKey?: string;\n roomCapacity: number;\n };\n}\n\nexport interface WebAPITimetable {\n id: number;\n lessonId: number;\n lessonNumber: number;\n lessonCode: string;\n lessonText: string;\n periodText: string;\n hasPeriodText: false;\n periodInfo: string;\n periodAttachments: [];\n substText: string;\n date: number;\n startTime: number;\n endTime: number;\n elements: WebElement[];\n studentGroup: string;\n hasInfo: boolean;\n code: number;\n cellState: 'STANDARD' | 'SUBSTITUTION' | 'ROOMSUBSTITUTION';\n priority: number;\n is: {\n roomSubstitution?: boolean;\n substitution?: boolean;\n standard?: boolean;\n event: boolean;\n };\n roomCapacity: number;\n studentCount: number;\n classes: WebElementData[];\n teachers: WebElementData[];\n subjects: WebElementData[];\n rooms: WebElementData[];\n students: WebElementData[];\n}\n\nexport interface Teacher {\n id: number;\n name: string;\n foreName: string;\n longName: string;\n foreColor: string;\n backColor: string;\n}\n\nexport interface Student {\n id: number;\n key: number;\n name: string;\n foreName: string;\n longName: string;\n gender: string;\n}\n\nexport interface Room {\n id: number;\n name: string;\n longName: string;\n alternateName: string | '';\n active: boolean;\n foreColor: string;\n backColor: string;\n}\n\nexport interface Klasse {\n id: number;\n name: string;\n longName: string;\n active: boolean;\n foreColor?: string;\n backColor?: string;\n did?: number;\n teacher1?: number;\n teacher2?: number;\n}\n\nexport interface Department {\n id: number;\n name: string;\n longName: string;\n}\n\nexport interface Holiday {\n name: string;\n longName: string;\n id: number;\n startDate: number;\n endDate: number;\n}\n\nexport interface ColorEntity {\n foreColor: string;\n backColor: string;\n}\n\nexport interface LsEntity {\n ls?: ColorEntity | null;\n oh?: ColorEntity | null;\n sb?: ColorEntity | null;\n bs?: ColorEntity | null;\n ex?: ColorEntity | null;\n}\n\nexport interface CodesEntity {\n cancelled?: ColorEntity | null;\n irregular?: ColorEntity | null;\n}\n\nexport interface StatusData {\n lstypes: LsEntity[];\n codes: CodesEntity[];\n}\n\nexport interface Absences {\n absences: Absence[];\n absenceReasons: [];\n excuseStatuses: boolean;\n showAbsenceReasonChange: boolean;\n showCreateAbsence: boolean;\n}\n\nexport interface Absence {\n id: number;\n startDate: number;\n endDate: number;\n startTime: number;\n endTime: number;\n createDate: number;\n lastUpdate: number;\n createdUser: string;\n updatedUser: string;\n reasonId: number;\n reason: string;\n text: string;\n interruptions: [];\n canEdit: boolean;\n studentName: string;\n excuseStatus: string;\n isExcused: boolean;\n excuse: Excuse;\n}\n\nexport interface Excuse {\n id: number;\n text: string;\n excuseDate: number;\n excuseStatus: string;\n isExcused: boolean;\n userId: number;\n username: string;\n}\n","import { serialize } from './cookie';\nimport axios from 'axios';\nimport { btoa } from './base-64';\nimport { parse, startOfDay, format } from 'date-fns';\nimport type { AxiosInstance } from 'axios';\nimport type {\n Absences,\n Department,\n Exam,\n Holiday,\n Homework,\n Inbox,\n Klasse,\n Lesson,\n NewsWidget,\n Room,\n SchoolYear,\n StatusData,\n Student,\n Subject,\n Teacher,\n Timegrid,\n WebAPITimetable,\n} from './types';\nimport type { InternalSchoolYear, SessionInformation } from './internal';\nimport { WebUntisElementType } from './types';\n\nexport class Base {\n school: string;\n schoolbase64: string;\n username: string;\n password: string;\n baseurl: string;\n cookies: string[];\n id: string;\n sessionInformation: SessionInformation | null;\n anonymous: boolean;\n\n axios: AxiosInstance;\n\n static TYPES = WebUntisElementType;\n\n /**\n *\n * @constructor\n * @param {string} school The school identifier\n * @param {string} username\n * @param {string} password\n * @param {string} baseurl Just the host name of your WebUntis (Example: mese.webuntis.com)\n * @param {string} [identity=\"Awesome\"] A identity like: MyAwesomeApp\n * @param {boolean} [disableUserAgent=false] If this is true, axios will not send a custom User-Agent\n */\n constructor(\n school: string,\n username: string,\n password: string,\n baseurl: string,\n identity = 'Awesome',\n disableUserAgent = false,\n ) {\n this.school = school;\n this.schoolbase64 = '_' + btoa(this.school);\n this.username = username;\n this.password = password;\n this.baseurl = 'https://' + baseurl + '/';\n this.cookies = [];\n this.id = identity;\n this.sessionInformation = {};\n this.anonymous = false;\n\n const additionalHeaders: Record = {};\n\n if (!disableUserAgent) {\n additionalHeaders['User-Agent'] =\n 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3163.79 Safari/537.36';\n }\n\n this.axios = axios.create({\n baseURL: this.baseurl,\n maxRedirects: 0,\n headers: {\n 'Cache-Control': 'no-cache',\n Pragma: 'no-cache',\n 'X-Requested-With': 'XMLHttpRequest',\n ...additionalHeaders,\n },\n validateStatus: function (status) {\n return status >= 200 && status < 303; // default\n },\n });\n }\n\n /**\n * Logout the current session\n */\n async logout(): Promise {\n await this.axios({\n method: 'POST',\n url: `/WebUntis/jsonrpc.do`,\n params: {\n school: this.school,\n },\n data: {\n id: this.id,\n method: 'logout',\n params: {},\n jsonrpc: '2.0',\n },\n });\n this.sessionInformation = null;\n return true;\n }\n\n /**\n * Login with your credentials\n *\n * **Notice: The server may revoke this session after less than 10min of idle.**\n *\n * *Untis says in the official docs:*\n * > An application should always log out as soon as possible to free system resources on the server.\n */\n async login(): Promise {\n const response = await this.axios({\n method: 'POST',\n url: `/WebUntis/jsonrpc.do`,\n params: {\n school: this.school,\n },\n data: {\n id: this.id,\n method: 'authenticate',\n params: {\n user: this.username,\n password: this.password,\n client: this.id,\n },\n jsonrpc: '2.0',\n },\n });\n if (typeof response.data !== 'object') throw new Error('Failed to parse server response.');\n if (!response.data.result) throw new Error('Failed to login. ' + JSON.stringify(response.data));\n if (response.data.result.code) throw new Error('Login returned error code: ' + response.data.result.code);\n if (!response.data.result.sessionId) throw new Error('Failed to login. No session id.');\n this.sessionInformation = response.data.result;\n return response.data.result;\n }\n\n /**\n * Get the latest WebUntis Schoolyear\n * @param {Boolean} [validateSession=true]\n */\n async getLatestSchoolyear(validateSession = true): Promise {\n const data = await this._request('getSchoolyears', {}, validateSession);\n data.sort((a, b) => {\n const na = parse(a.startDate, 'yyyyMMdd', new Date());\n const nb = parse(b.startDate, 'yyyyMMdd', new Date());\n return nb.getTime() - na.getTime();\n });\n if (!data[0]) throw new Error('Failed to receive school year');\n return {\n name: data[0].name,\n id: data[0].id,\n startDate: parse(data[0].startDate, 'yyyyMMdd', new Date()),\n endDate: parse(data[0].endDate, 'yyyyMMdd', new Date()),\n };\n }\n\n /**\n * Get all WebUntis Schoolyears\n * @param {Boolean} [validateSession=true]\n */\n async getSchoolyears(validateSession = true): Promise {\n const data = await this._request('getSchoolyears', {}, validateSession);\n data.sort((a, b) => {\n const na = parse(a.startDate, 'yyyyMMdd', new Date());\n const nb = parse(b.startDate, 'yyyyMMdd', new Date());\n return nb.getTime() - na.getTime();\n });\n if (!data[0]) throw new Error('Failed to receive school year');\n return data.map((year) => {\n return {\n name: year.name,\n id: year.id,\n startDate: parse(year.startDate, 'yyyyMMdd', new Date()),\n endDate: parse(year.endDate, 'yyyyMMdd', new Date()),\n };\n });\n }\n\n /**\n * Get News Widget\n * @param {Date} date\n * @param {boolean} [validateSession=true]\n * @returns {Promise} see index.d.ts NewsWidget\n */\n async getNewsWidget(date: Date, validateSession = true): Promise {\n if (validateSession && !(await this.validateSession())) throw new Error('Current Session is not valid');\n const response = await this.axios({\n method: 'GET',\n url: `/WebUntis/api/public/news/newsWidgetData`,\n params: {\n date: Base.convertDateToUntis(date),\n },\n headers: {\n Cookie: this._buildCookies(),\n },\n });\n if (typeof response.data.data !== 'object') throw new Error('Server returned invalid data.');\n return response.data.data;\n }\n\n /**\n * Get Inbox\n */\n async getInbox(validateSession = true): Promise {\n this._checkAnonymous();\n if (validateSession && !(await this.validateSession())) throw new Error('Current Session is not valid');\n //first get JWT Token\n if (typeof this.sessionInformation!.jwt_token != 'string') await this._getJWT();\n const response = await this.axios({\n method: 'GET',\n url: `/WebUntis/api/rest/view/v1/messages`,\n headers: {\n Authorization: `Bearer ${this.sessionInformation!.jwt_token}`,\n Cookie: this._buildCookies(),\n },\n });\n if (typeof response.data !== 'object') throw new Error('Server returned invalid data.');\n return response.data;\n }\n\n private _checkAnonymous() {\n if (this.anonymous) {\n throw new Error('This method is not supported with anonymous login');\n }\n }\n\n /**\n *\n * @returns {string}\n * @private\n */\n _buildCookies() {\n let cookies = [];\n cookies.push(serialize('JSESSIONID', this.sessionInformation!.sessionId!));\n cookies.push(serialize('schoolname', this.schoolbase64));\n return cookies.join('; ');\n }\n\n /**\n * Get JWT Token\n * @private\n */\n async _getJWT(validateSession = true): Promise {\n if (validateSession && !(await this.validateSession())) throw new Error('Current Session is not valid');\n const response = await this.axios({\n method: 'GET',\n url: `/WebUntis/api/token/new`,\n headers: {\n //Authorization: `Bearer ${this._getToken()}`,\n Cookie: this._buildCookies(),\n },\n });\n\n if (typeof response.data !== 'string') throw new Error('Server returned invalid data.');\n this.sessionInformation!.jwt_token = response.data;\n return response.data;\n }\n\n /**\n * Checks if your current WebUntis Session is valid\n */\n async validateSession(): Promise {\n if (!this.sessionInformation) return false;\n const response = await this.axios({\n method: 'POST',\n url: `/WebUntis/jsonrpc.do`,\n params: {\n school: this.school,\n },\n headers: {\n Cookie: this._buildCookies(),\n },\n data: {\n id: this.id,\n method: 'getLatestImportTime',\n params: {},\n jsonrpc: '2.0',\n },\n });\n return typeof response.data.result === 'number';\n }\n\n /**\n * Get the time when WebUntis last changed its data\n * @param {Boolean} [validateSession=true]\n */\n async getLatestImportTime(validateSession = true): Promise {\n return this._request('getLatestImportTime', {}, validateSession);\n }\n\n /**\n *\n * @param id\n * @param type\n * @param startDate\n * @param endDate\n * @param validateSession\n * @private\n */\n private async _timetableRequest(\n id: string | number,\n type: number,\n startDate?: Date | null,\n endDate?: Date | null,\n validateSession = true,\n ): Promise {\n const additionalOptions: Record = {};\n if (startDate) {\n additionalOptions.startDate = Base.convertDateToUntis(startDate);\n }\n if (endDate) {\n additionalOptions.endDate = Base.convertDateToUntis(endDate);\n }\n\n return this._request(\n 'getTimetable',\n {\n options: {\n id: new Date().getTime(),\n element: {\n id,\n type,\n },\n ...additionalOptions,\n showLsText: true,\n showStudentgroup: true,\n showLsNumber: true,\n showSubstText: true,\n showInfo: true,\n showBooking: true,\n klasseFields: ['id', 'name', 'longname', 'externalkey'],\n roomFields: ['id', 'name', 'longname', 'externalkey'],\n subjectFields: ['id', 'name', 'longname', 'externalkey'],\n teacherFields: ['id', 'name', 'longname', 'externalkey'],\n },\n },\n validateSession,\n );\n }\n\n /**\n * Get your own Timetable for the current day\n * Note: You can't use this with anonymous login\n * @param {Boolean} [validateSession=true]\n * @returns {Promise}\n */\n async getOwnTimetableForToday(validateSession = true): Promise {\n this._checkAnonymous();\n return await this._timetableRequest(\n this.sessionInformation!.personId!,\n this.sessionInformation!.personType!,\n null,\n null,\n validateSession,\n );\n }\n\n /**\n * Get the timetable of today for a specific element.\n * @param {number} id\n * @param {WebUntisElementType} type\n * @param {Boolean} [validateSession=true]\n * @returns {Promise}\n */\n async getTimetableForToday(id: number, type: number, validateSession = true): Promise {\n return await this._timetableRequest(id, type, null, null, validateSession);\n }\n\n /**\n * Get your own Timetable for the given day\n * Note: You can't use this with anonymous login\n * @param {Date} date\n * @param {Boolean} [validateSession=true]\n */\n async getOwnTimetableFor(date: Date, validateSession = true): Promise {\n this._checkAnonymous();\n return await this._timetableRequest(\n this.sessionInformation!.personId!,\n this.sessionInformation!.personType!,\n date,\n date,\n validateSession,\n );\n }\n\n /**\n * Get the timetable for a specific day for a specific element.\n * @param {Date} date\n * @param {number} id\n * @param {WebUntisElementType} type\n * @param {Boolean} [validateSession=true]\n */\n async getTimetableFor(date: Date, id: number, type: number, validateSession = true): Promise {\n return await this._timetableRequest(id, type, date, date, validateSession);\n }\n\n /**\n * Get your own timetable for a given Date range\n * Note: You can't use this with anonymous login\n * @param {Date} rangeStart\n * @param {Date} rangeEnd\n * @param {Boolean} [validateSession=true]\n * @returns {Promise.}\n */\n async getOwnTimetableForRange(rangeStart: Date, rangeEnd: Date, validateSession = true): Promise {\n this._checkAnonymous();\n return await this._timetableRequest(\n this.sessionInformation!.personId!,\n this.sessionInformation!.personType!,\n rangeStart,\n rangeEnd,\n validateSession,\n );\n }\n\n /**\n * Get the timetable for a given Date range for specific element\n * @param {Date} rangeStart\n * @param {Date} rangeEnd\n * @param {number} id\n * @param {WebUntisElementType} type\n * @param {Boolean} [validateSession=true]\n */\n async getTimetableForRange(\n rangeStart: Date,\n rangeEnd: Date,\n id: number,\n type: number,\n validateSession = true,\n ): Promise {\n return await this._timetableRequest(id, type, rangeStart, rangeEnd, validateSession);\n }\n\n /**\n * Get the Timetable of your class for today\n * Note: You can't use this with anonymous login\n * @param {Boolean} [validateSession=true]\n * @returns {Promise}\n */\n async getOwnClassTimetableForToday(validateSession = true): Promise {\n this._checkAnonymous();\n return await this._timetableRequest(this.sessionInformation!.klasseId!, 1, null, null, validateSession);\n }\n\n /**\n * Get the Timetable of your class for the given day\n * Note: You can't use this with anonymous login\n * @param {Date} date\n * @param {Boolean} [validateSession=true]\n * @returns {Promise.}\n */\n async getOwnClassTimetableFor(date: Date, validateSession = true): Promise {\n this._checkAnonymous();\n return await this._timetableRequest(this.sessionInformation!.klasseId!, 1, date, date, validateSession);\n }\n\n /**\n * Get the Timetable of your class for a given Date range\n * Note: You can't use this with anonymous login\n * @param {Date} rangeStart\n * @param {Date} rangeEnd\n * @param {boolean} [validateSession=true]\n */\n async getOwnClassTimetableForRange(rangeStart: Date, rangeEnd: Date, validateSession = true): Promise {\n this._checkAnonymous();\n return await this._timetableRequest(\n this.sessionInformation!.klasseId!,\n 1,\n rangeStart,\n rangeEnd,\n validateSession,\n );\n }\n\n /**\n *\n * @param {Date} rangeStart\n * @param {Date} rangeEnd\n * @param {boolean} [validateSession=true]\n * @returns {Promise.}\n */\n async getHomeWorksFor(rangeStart: Date, rangeEnd: Date, validateSession = true): Promise {\n if (validateSession && !(await this.validateSession())) throw new Error('Current Session is not valid');\n const response = await this.axios({\n method: 'GET',\n url: `/WebUntis/api/homeworks/lessons`,\n params: {\n startDate: Base.convertDateToUntis(rangeStart),\n endDate: Base.convertDateToUntis(rangeEnd),\n },\n headers: {\n Cookie: this._buildCookies(),\n },\n });\n if (typeof response.data.data !== 'object') throw new Error('Server returned invalid data.');\n if (!response.data.data['homeworks']) throw new Error(\"Data object doesn't contains homeworks object.\");\n return response.data.data;\n }\n\n /**\n * Converts the untis date string format to a normal JS Date object\n * @param {string} date Untis date string\n * @param {Date} [baseDate=new Date()] Base date. Default beginning of current day\n * @static\n */\n static convertUntisDate(date: string, baseDate = startOfDay(new Date())): Date {\n if (typeof date !== 'string') date = `${date}`;\n return parse(date, 'yyyyMMdd', baseDate);\n }\n\n /**\n * Convert a untis time string to a JS Date object\n * @param {string|number} time Untis time string\n * @param {Date} [baseDate=new Date()] Day used as base for the time. Default: Current date\n * @static\n */\n static convertUntisTime(time: number | string, baseDate = new Date()): Date {\n if (typeof time !== 'string') time = `${time}`;\n return parse(time.padStart(4, '0'), 'Hmm', baseDate);\n }\n\n /**\n * Get all known Subjects for the current logged-in user\n * @param {boolean} [validateSession=true]\n */\n async getSubjects(validateSession = true): Promise {\n return await this._request('getSubjects', {}, validateSession);\n }\n\n /**\n * Get the timegrid of current school\n * @param {boolean} [validateSession=true]\n * @returns {Promise.}\n */\n async getTimegrid(validateSession = true): Promise {\n return await this._request('getTimegridUnits', {}, validateSession);\n }\n\n /**\n *\n * TODO: Find out what type this function returns\n * @param {Date} rangeStart\n * @param {Date} rangeEnd\n * @param {boolean} [validateSession=true]\n * @returns {Promise.}\n */\n async getHomeWorkAndLessons(rangeStart: Date, rangeEnd: Date, validateSession = true): Promise> {\n if (validateSession && !(await this.validateSession())) throw new Error('Current Session is not valid');\n const response = await this.axios({\n method: 'GET',\n url: `/WebUntis/api/homeworks/lessons`,\n params: {\n startDate: Base.convertDateToUntis(rangeStart),\n endDate: Base.convertDateToUntis(rangeEnd),\n },\n headers: {\n Cookie: this._buildCookies(),\n },\n });\n if (typeof response.data.data !== 'object') throw new Error('Server returned invalid data.');\n if (!response.data.data['homeworks']) throw new Error(\"Data object doesn't contains homeworks object.\");\n return response.data.data;\n }\n\n /**\n * Get Exams for range\n * @param {Date} rangeStart\n * @param {Date} rangeEnd\n * @param {Number} klasseId\n * @param {boolean} withGrades\n * @param {boolean} [validateSession=true]\n */\n async getExamsForRange(\n rangeStart: Date,\n rangeEnd: Date,\n klasseId = -1,\n withGrades = false,\n validateSession = true,\n ): Promise> {\n if (validateSession && !(await this.validateSession())) throw new Error('Current Session is not valid');\n const response = await this.axios({\n method: 'GET',\n url: `/WebUntis/api/exams`,\n params: {\n startDate: Base.convertDateToUntis(rangeStart),\n endDate: Base.convertDateToUntis(rangeEnd),\n klasseId: klasseId,\n withGrades: withGrades,\n },\n headers: {\n Cookie: this._buildCookies(),\n },\n });\n if (typeof response.data.data !== 'object') throw new Error('Server returned invalid data.');\n if (!response.data.data['exams']) throw new Error(\"Data object doesn't contains exams object.\");\n return response.data.data['exams'];\n }\n\n /**\n * Get the timetable for the current week for a specific element from the web client API.\n * @param {Date} date one date in the week to query\n * @param {number} id element id\n * @param {WebUntisElementType} type element type\n * @param {Number} [formatId=1] set to 1 to include teachers, 2 omits the teachers in elements response\n * @param {Boolean} [validateSession=true]\n */\n async getTimetableForWeek(\n date: Date,\n id: number,\n type: number,\n formatId = 1,\n validateSession = true,\n ): Promise {\n if (validateSession && !(await this.validateSession())) throw new Error('Current Session is not valid');\n\n const response = await this.axios({\n method: 'GET',\n url: `/WebUntis/api/public/timetable/weekly/data`,\n params: {\n elementType: type,\n elementId: id,\n date: format(date, 'yyyy-MM-dd'),\n formatId: formatId,\n },\n headers: {\n Cookie: this._buildCookies(),\n },\n });\n\n if (typeof response.data.data !== 'object') throw new Error('Server returned invalid data.');\n\n if (response.data.data.error) {\n /* known codes:\n * - ERR_TTVIEW_NOTALLOWED_ONDATE\n */\n const err = new Error('Server responded with error');\n // TODO: Make this better lol\n // @ts-ignore\n err.code = response.data.data.error?.data?.messageKey;\n throw err;\n }\n\n if (!response.data.data.result?.data?.elementPeriods?.[id]) throw new Error('Invalid response');\n\n const data = response.data.data.result.data;\n\n // TODO: improve typings\n\n const formatElements = (elements: Array>, { byType }: { byType: number }) => {\n const filteredElements = elements.filter((element) => element.type === byType);\n\n return filteredElements.map((element) => ({\n ...element,\n element: data.elements.find(\n (dataElement: Record) =>\n dataElement.type === byType && dataElement.id === element.id,\n ),\n }));\n };\n\n const timetable = data.elementPeriods[id].map((lesson: any) => ({\n ...lesson,\n classes: formatElements(lesson.elements, { byType: Base.TYPES.CLASS }),\n teachers: formatElements(lesson.elements, { byType: Base.TYPES.TEACHER }),\n subjects: formatElements(lesson.elements, { byType: Base.TYPES.SUBJECT }),\n rooms: formatElements(lesson.elements, { byType: Base.TYPES.ROOM }),\n students: formatElements(lesson.elements, { byType: Base.TYPES.STUDENT }),\n }));\n\n return timetable;\n }\n\n /**\n * Get the timetable for the current week for the current element from the web client API.\n * @param {Date} date one date in the week to query\n * @param {Number} [formatId=1] set to 1 to include teachers, 2 omits the teachers in elements response\n * @param {Boolean} [validateSession=true]\n * @returns {Promise}\n */\n async getOwnTimetableForWeek(date: Date, formatId = 1, validateSession = true): Promise {\n this._checkAnonymous();\n return await this.getTimetableForWeek(\n date,\n this.sessionInformation!.personId!,\n this.sessionInformation!.personType!,\n formatId,\n validateSession,\n );\n }\n\n /**\n * Get all known teachers by WebUntis\n * @param {boolean} [validateSession=true]\n * @returns {Promise.}\n */\n async getTeachers(validateSession = true): Promise {\n return await this._request('getTeachers', {}, validateSession);\n }\n\n /**\n * Get all known students by WebUntis\n * @param {boolean} [validateSession=true]\n * @returns {Promise.}\n */\n async getStudents(validateSession = true): Promise {\n return await this._request('getStudents', {}, validateSession);\n }\n\n /**\n * Get all known rooms by WebUntis\n * @param {boolean} [validateSession=true]\n * @returns {Promise.}\n */\n async getRooms(validateSession = true): Promise {\n return await this._request('getRooms', {}, validateSession);\n }\n\n /**\n * Get all classes known by WebUntis\n * @param {boolean} [validateSession=true]\n * @param {number} schoolyearId\n * @returns {Promise.}\n */\n async getClasses(validateSession = true, schoolyearId: number): Promise {\n const data = typeof schoolyearId !== 'number' ? {} : { schoolyearId };\n return await this._request('getKlassen', data, validateSession);\n }\n\n /**\n * Get all departments known by WebUntis\n * @param {boolean} [validateSession=true]\n * @returns {Promise.}\n */\n async getDepartments(validateSession = true): Promise {\n return await this._request('getDepartments', {}, validateSession);\n }\n\n /**\n * Get all holidays known by WebUntis\n * @param {boolean} [validateSession=true]\n * @returns {Promise.}\n */\n async getHolidays(validateSession = true): Promise {\n return await this._request('getHolidays', {}, validateSession);\n }\n\n /**\n * Get all status data known by WebUntis\n * @param {boolean} [validateSession=true]\n * @returns {Promise.}\n */\n async getStatusData(validateSession = true): Promise {\n return await this._request('getStatusData', {}, validateSession);\n }\n\n /**\n * Get the current school year\n * @param [validateSession=true]\n * @returns {Promise.}\n */\n async getCurrentSchoolyear(validateSession = true): Promise {\n const data = await this._request('getCurrentSchoolyear', {}, validateSession);\n\n if (!data) throw new Error('Failed to retrieve current school year');\n\n return {\n name: data.name,\n id: data.id,\n startDate: Base.convertUntisDate(data.startDate),\n endDate: Base.convertUntisDate(data.endDate),\n };\n }\n\n /**\n * Convert a JS Date Object to a WebUntis date string\n * @param {Date} date\n * @returns {String}\n */\n static convertDateToUntis(date: Date): string {\n return (\n date.getFullYear().toString() +\n (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1).toString() +\n (date.getDate() < 10 ? '0' + date.getDate() : date.getDate()).toString()\n );\n }\n\n /**\n * Make a JSON RPC Request with the current session\n * @param {string} method\n * @param {Object} [parameter={}]\n * @param {string} [url='/WebUntis/jsonrpc.do?school=SCHOOL']\n * @param {boolean} [validateSession=true] Whether the session should be checked first\n * @returns {Promise.}\n * @private\n */\n async _request>(\n method: string,\n parameter: Record = {},\n validateSession = true,\n url = `/WebUntis/jsonrpc.do`,\n ): Promise {\n if (validateSession && !(await this.validateSession())) throw new Error('Current Session is not valid');\n const response = await this.axios({\n method: 'POST',\n url: url,\n params: {\n school: this.school,\n },\n headers: {\n Cookie: this._buildCookies(),\n },\n data: {\n id: this.id,\n method: method,\n params: parameter,\n jsonrpc: '2.0',\n },\n });\n if (!response.data.result) throw new Error(\"Server didn't return any result.\");\n if (response.data.result.code) throw new Error('Server returned error code: ' + response.data.result.code);\n return response.data.result;\n }\n\n /**\n * Returns all the Lessons where you were absent including the excused one!\n * @param {Date} rangeStart\n * @param {Date} rangeEnd\n * @param {Integer} [excuseStatusId=-1]\n * @param {boolean} [validateSession=true]\n * @returns {Promise}\n */\n async getAbsentLesson(\n rangeStart: Date,\n rangeEnd: Date,\n excuseStatusId = -1,\n validateSession = true,\n ): Promise {\n if (validateSession && !(await this.validateSession())) throw new Error('Current Session is not valid');\n this._checkAnonymous();\n const response = await this.axios({\n method: 'GET',\n url: `/WebUntis/api/classreg/absences/students`,\n params: {\n startDate: Base.convertDateToUntis(rangeStart),\n endDate: Base.convertDateToUntis(rangeEnd),\n studentId: this.sessionInformation!.personId!,\n excuseStatusId: excuseStatusId,\n },\n headers: {\n Cookie: this._buildCookies(),\n },\n });\n if (response.data.data == null) throw new Error('Server returned no data!');\n return response.data.data;\n }\n\n /**\n * Returns a URL to a unique PDF of all the lessons you were absent\n * @param {Date} rangeStart\n * @param {Date} rangeEnd\n * @param {boolean} [validateSession=true]\n * @param {Integer} [excuseStatusId=-1]\n * @param {boolean} [lateness=true]\n * @param {boolean} [absences=true]\n * @param {boolean} [excuseGroup=2]\n */\n async getPdfOfAbsentLesson(\n rangeStart: Date,\n rangeEnd: Date,\n validateSession = true,\n excuseStatusId = -1,\n lateness = true,\n absences = true,\n excuseGroup = 2,\n ): Promise {\n if (validateSession && !(await this.validateSession())) throw new Error('Current Session is not valid');\n this._checkAnonymous();\n const response = await this.axios({\n method: 'GET',\n url: `/WebUntis/reports.do`,\n params: {\n name: 'Excuse',\n format: 'pdf',\n rpt_sd: Base.convertDateToUntis(rangeStart),\n rpt_ed: Base.convertDateToUntis(rangeEnd),\n excuseStatusId: excuseStatusId,\n studentId: this.sessionInformation!.personId!,\n withLateness: lateness,\n withAbsences: absences,\n execuseGroup: excuseGroup,\n },\n headers: {\n Cookie: this._buildCookies(),\n },\n });\n const res = response.data.data;\n if (response.status != 200 || res.error) throw new Error('Server returned no data!');\n const pdfDownloadURL =\n this.baseurl + 'WebUntis/reports.do?' + 'msgId=' + res.messageId + '&' + res.reportParams;\n return pdfDownloadURL;\n }\n}\n\n/**\n * @private\n */\nexport class InternalWebuntisSecretLogin extends Base {\n constructor(\n school: string,\n username: string,\n password: string,\n baseurl: string,\n identity = 'Awesome',\n disableUserAgent = false,\n ) {\n super(school, username, password, baseurl, identity, disableUserAgent);\n }\n\n async _otpLogin(token: number | string, username: string, time: number, skipSessionInfo = false) {\n const response = await this.axios({\n method: 'POST',\n url: '/WebUntis/jsonrpc_intern.do',\n params: {\n m: 'getUserData2017',\n school: this.school,\n v: 'i2.2',\n },\n data: {\n id: this.id,\n method: 'getUserData2017',\n params: [\n {\n auth: {\n clientTime: time,\n user: username,\n otp: token,\n },\n },\n ],\n jsonrpc: '2.0',\n },\n });\n if (response.data && response.data.error)\n throw new Error('Failed to login. ' + (response.data.error.message || ''));\n if (!response.headers['set-cookie']) throw new Error(`Failed to login. Server didn't return a set-cookie`);\n if (!this._getCookieFromSetCookie(response.headers['set-cookie']))\n throw new Error(\"Failed to login. Server didn't return a session id.\");\n const sessionId = this._getCookieFromSetCookie(response.headers['set-cookie']);\n // Set session temporary\n this.sessionInformation = {\n sessionId: sessionId,\n };\n if (skipSessionInfo) return this.sessionInformation;\n\n // Get personId & personType\n const appConfigUrl = `/WebUntis/api/app/config`;\n const configResponse = await this.axios({\n method: 'GET',\n url: appConfigUrl,\n headers: {\n Cookie: this._buildCookies(),\n },\n });\n if (typeof configResponse.data !== 'object' || typeof configResponse.data.data !== 'object')\n throw new Error('Failed to fetch app config while login. data (type): ' + typeof response.data);\n // Path -> data.loginServiceConfig.user.persons -> find person with id\n if (\n configResponse.data.data &&\n configResponse.data.data.loginServiceConfig &&\n configResponse.data.data.loginServiceConfig.user &&\n !Number.isInteger(configResponse.data.data.loginServiceConfig.user.personId)\n )\n throw new Error('Invalid personId. personId: ' + configResponse.data.data.loginServiceConfig.user.personId);\n const webUntisLoginServiceUser = configResponse.data.data.loginServiceConfig.user;\n if (!Array.isArray(webUntisLoginServiceUser.persons))\n throw new Error('Invalid person array. persons (type): ' + typeof webUntisLoginServiceUser.persons);\n const person = webUntisLoginServiceUser.persons.find(\n (value: Record) => value.id === configResponse.data.data.loginServiceConfig.user.personId,\n );\n if (!person) throw new Error('Can not find person in person array.');\n if (!Number.isInteger(person.type)) throw new Error('Invalid person type. type (type): ' + person.type);\n this.sessionInformation = {\n sessionId: sessionId,\n personType: person.type,\n personId: configResponse.data.data.loginServiceConfig.user.personId,\n };\n // Get klasseId\n try {\n const dayConfigUrl = `/WebUntis/api/daytimetable/config`;\n const dayConfigResponse = await this.axios({\n method: 'GET',\n url: dayConfigUrl,\n headers: {\n Cookie: this._buildCookies(),\n },\n });\n if (typeof dayConfigResponse.data !== 'object' || typeof dayConfigResponse.data.data !== 'object')\n throw new Error();\n if (!Number.isInteger(dayConfigResponse.data.data.klasseId)) throw new Error();\n this.sessionInformation = {\n sessionId: sessionId,\n personType: person.type,\n personId: configResponse.data.data.loginServiceConfig.user.personId,\n klasseId: dayConfigResponse.data.data.klasseId,\n };\n } catch (e) {\n // klasseId is not important. This request can fail\n }\n return this.sessionInformation;\n }\n\n /**\n *\n * @param {Array} setCookieArray\n * @param {string} [cookieName=\"JSESSIONID\"]\n * @return {string|boolean}\n * @private\n */\n _getCookieFromSetCookie(setCookieArray?: string[], cookieName = 'JSESSIONID') {\n if (!setCookieArray) return;\n for (let i = 0; i < setCookieArray.length; i++) {\n const setCookie = setCookieArray[i];\n if (!setCookie) continue;\n let cookieParts = setCookie.split(';');\n if (!cookieParts || !Array.isArray(cookieParts)) continue;\n for (let cookie of cookieParts) {\n cookie = cookie.trim();\n cookie = cookie.replace(/;/gm, '');\n const [Key, Value] = cookie.split('=');\n if (!Key || !Value) continue;\n if (Key === cookieName) return Value;\n }\n }\n }\n}\n","import { InternalWebuntisSecretLogin } from './base';\nimport type { authenticator } from 'otplib';\n\nexport type Authenticator = typeof authenticator;\n\nexport class WebUntisSecretAuth extends InternalWebuntisSecretLogin {\n private readonly secret: string;\n private authenticator: Authenticator;\n\n /**\n *\n * @constructor\n * @augments WebUntis\n * @param {string} school The school identifier\n * @param {string} user\n * @param {string} secret\n * @param {string} baseurl Just the host name of your WebUntis (Example: mese.webuntis.com)\n * @param {string} [identity=\"Awesome\"] A identity like: MyAwesomeApp\n * @param {Object} authenticator Custom otplib v12 instance. Default will use the default otplib configuration.\n * @param {boolean} [disableUserAgent=false] If this is true, axios will not send a custom User-Agent\n */\n constructor(\n school: string,\n user: string,\n secret: string,\n baseurl: string,\n identity = 'Awesome',\n authenticator: Authenticator,\n disableUserAgent = false,\n ) {\n super(school, user, null as unknown as string, baseurl, identity, disableUserAgent);\n this.secret = secret;\n this.authenticator = authenticator;\n if (!authenticator) {\n if ('import' in globalThis) {\n throw new Error(\n 'You need to provide the otplib object by yourself. We can not eval the require in ESM mode.',\n );\n }\n // React-Native will not eval this expression\n const { authenticator } = eval(\"require('otplib')\");\n this.authenticator = authenticator;\n }\n }\n\n // @ts-ignore\n async login() {\n // Get JSESSION\n const token = this.authenticator.generate(this.secret);\n const time = new Date().getTime();\n return await this._otpLogin(token, this.username, time);\n }\n}\n","import { WebUntisSecretAuth } from './secret';\nimport type { Authenticator } from './secret';\nimport type { URL } from 'url';\n\n/**\n * @private\n */\nexport type URLClass = typeof URL;\n\nexport class WebUntisQR extends WebUntisSecretAuth {\n /**\n * Use the data you get from a WebUntis QR code\n * @constructor\n * @param {string} QRCodeURI A WebUntis uri. This is the data you get from the QR Code from the webuntis webapp under profile->Data access->Display\n * @param {string} [identity=\"Awesome\"] A identity like: MyAwesomeApp\n * @param {Object} authenticator Custom otplib v12 instance. Default will use the default otplib configuration.\n * @param {Object} URL Custom whatwg url implementation. Default will use the nodejs implementation.\n * @param {boolean} [disableUserAgent=false] If this is true, axios will not send a custom User-Agent\n */\n constructor(\n QRCodeURI: string,\n identity: string,\n authenticator: Authenticator,\n URL?: URLClass,\n disableUserAgent = false,\n ) {\n let URLImplementation = URL;\n if (!URL) {\n if ('import' in globalThis) {\n throw new Error(\n 'You need to provide the URL object by yourself. We can not eval the require in ESM mode.',\n );\n }\n // React-Native will not eval this expression\n URLImplementation = eval(\"require('url').URL\") as URLClass;\n }\n const uri = new URLImplementation!(QRCodeURI);\n super(\n uri.searchParams.get('school')!,\n uri.searchParams.get('user')!,\n uri.searchParams.get('key')!,\n uri.searchParams.get('url')!,\n identity,\n authenticator,\n disableUserAgent,\n );\n }\n}\n","import { InternalWebuntisSecretLogin } from './base';\n\nexport class WebUntisAnonymousAuth extends InternalWebuntisSecretLogin {\n /**\n *\n * @param {string} school\n * @param {string} baseurl\n * @param {string} [identity='Awesome']\n * @param {boolean} [disableUserAgent=false] If this is true, axios will not send a custom User-Agent\n */\n constructor(school: string, baseurl: string, identity = 'Awesome', disableUserAgent = false) {\n // TODO: Make this a bit more beautiful and more type safe\n super(school, null as unknown as string, null as unknown as string, baseurl, identity, disableUserAgent);\n this.username = '#anonymous#';\n this.anonymous = true;\n }\n\n override async login() {\n // Check whether the school has public access or not\n const url = `/WebUntis/jsonrpc_intern.do`;\n\n const response = await this.axios({\n method: 'POST',\n url,\n params: {\n m: 'getAppSharedSecret',\n school: this.school,\n v: 'i3.5',\n },\n data: {\n id: this.id,\n method: 'getAppSharedSecret',\n params: [\n {\n userName: '#anonymous#',\n password: '',\n },\n ],\n jsonrpc: '2.0',\n },\n });\n\n if (response.data && response.data.error)\n throw new Error('Failed to login. ' + (response.data.error.message || ''));\n\n // OTP never changes when using anonymous login\n const otp = 100170;\n const time = new Date().getTime();\n return await this._otpLogin(otp, this.username, time, true);\n }\n}\n"],"names":["WebUntisDay","WebUntisElementType","__publicField","parse","startOfDay","format"],"mappings":";;;;;AAkBA,MAAM,kBAAqB,GAAA,uCAAA,CAAA;AA0DpB,SAAS,SAAU,CAAA,IAAA,EAAc,GAAa,EAAA,GAAA,GAAwB,EAAY,EAAA;AACrF,EAAA,IAAI,CAAC,GAAI,CAAA,MAAA;AAAQ,IAAA,GAAA,CAAI,MAAS,GAAA,kBAAA,CAAA;AAE9B,EAAI,IAAA,CAAC,kBAAmB,CAAA,IAAA,CAAK,IA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+{"version":3,"file":"webuntis.js","sources":["../src/cookie.ts","../src/base-64.ts","../src/types.ts","../src/base.ts","../src/secret.ts","../src/qr.ts","../src/anonymous.ts"],"sourcesContent":["/**\n * Shamelessly stolen from @tinyhttp/cookie.\n *\n * Because @tinyhttp/cookie doesn't provide a commonjs build, I just decided to include the source code.\n * We need a cjs build, because we generate both esm and cjs.\n */\n\nconst pairSplitRegExp = /; */;\n\n/**\n * RegExp to match field-content in RFC 7230 sec 3.2\n *\n * field-content = field-vchar [ 1*( SP / HTAB ) field-vchar ]\n * field-vchar = VCHAR / obs-text\n * obs-text = %x80-FF\n */\n\n// eslint-disable-next-line no-control-regex\nconst fieldContentRegExp = /^[\\u0009\\u0020-\\u007e\\u0080-\\u00ff]+$/;\n\nfunction tryDecode(str: string, decode: (str: string) => string) {\n try {\n return decode(str);\n } catch (e) {\n return str;\n }\n}\n\n/**\n * Parse a cookie header.\n *\n * Parse the given cookie header string into an object\n * The object has the various cookies as keys(names) => values\n *\n */\nexport function parse(\n str: string,\n options: {\n decode: (str: string) => string;\n } = {\n decode: decodeURIComponent,\n },\n): Record {\n const obj: Record = {};\n const pairs = str.split(pairSplitRegExp);\n\n for (const pair of pairs) {\n let eqIdx = pair.indexOf('=');\n\n // skip things that don't look like key=value\n if (eqIdx < 0) continue;\n\n const key = pair.substr(0, eqIdx).trim();\n let val = pair.substr(++eqIdx, pair.length).trim();\n\n // quoted values\n if ('\"' == val[0]) val = val.slice(1, -1);\n\n // only assign once\n if (obj[key] == null) obj[key] = tryDecode(val, options.decode);\n }\n\n return obj;\n}\n\nexport type SerializeOptions = Partial<{\n encode: (str: string) => string;\n maxAge: number;\n domain: string;\n path: string;\n httpOnly: boolean;\n secure: boolean;\n sameSite: boolean | 'Strict' | 'strict' | 'Lax' | 'lax' | 'None' | 'none' | string;\n expires: Date;\n}>;\n\nexport function serialize(name: string, val: string, opt: SerializeOptions = {}): string {\n if (!opt.encode) opt.encode = encodeURIComponent;\n\n if (!fieldContentRegExp.test(name)) throw new TypeError('argument name is invalid');\n\n const value = opt.encode(val);\n\n if (value && !fieldContentRegExp.test(value)) throw new TypeError('argument val is invalid');\n\n let str = name + '=' + value;\n\n if (null != opt.maxAge) {\n const maxAge = opt.maxAge - 0;\n\n if (isNaN(maxAge) || !isFinite(maxAge)) throw new TypeError('option maxAge is invalid');\n\n str += '; Max-Age=' + Math.floor(maxAge);\n }\n\n if (opt.domain) {\n if (!fieldContentRegExp.test(opt.domain)) throw new TypeError('option domain is invalid');\n\n str += '; Domain=' + opt.domain;\n }\n\n if (opt.path) {\n if (!fieldContentRegExp.test(opt.path)) throw new TypeError('option path is invalid');\n\n str += '; Path=' + opt.path;\n }\n\n if (opt.expires) str += '; Expires=' + opt.expires.toUTCString();\n\n if (opt.httpOnly) str += '; HttpOnly';\n\n if (opt.secure) str += '; Secure';\n\n if (opt.sameSite) {\n const sameSite = typeof opt.sameSite === 'string' ? opt.sameSite.toLowerCase() : opt.sameSite;\n\n switch (sameSite) {\n case true:\n case 'strict':\n str += '; SameSite=Strict';\n break;\n case 'lax':\n str += '; SameSite=Lax';\n break;\n case 'none':\n str += '; SameSite=None';\n break;\n default:\n throw new TypeError('option sameSite is invalid');\n }\n }\n\n return str;\n}\n","const chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';\nexport function btoa(input = '') {\n let str = input;\n let output = '';\n\n for (\n let block = 0, charCode, i = 0, map = chars;\n str.charAt(i | 0) || ((map = '='), i % 1);\n output += map.charAt(63 & (block >> (8 - (i % 1) * 8)))\n ) {\n charCode = str.charCodeAt((i += 3 / 4));\n\n if (charCode > 0xff) {\n throw new Error(\"'btoa' failed: The string to be encoded contains characters outside of the Latin1 range.\");\n }\n\n block = (block << 8) | charCode;\n }\n\n return output;\n}\n","export interface SchoolYear {\n name: string;\n id: number;\n startDate: Date;\n endDate: Date;\n}\n\nexport interface MessagesOfDay {\n id: number;\n subject: string;\n text: string;\n isExpanded: boolean;\n /**\n * Unknown type. I have never seen this in use.\n */\n attachments: any[];\n}\n\nexport interface NewsWidget {\n /**\n * Unknown type. I have never seen this in use.\n */\n systemMessage: any;\n messagesOfDay: MessagesOfDay[];\n rssUrl: string;\n}\n\nexport interface Messagesender {\n userId: number;\n displayName: string;\n imageUrl: string;\n className: string;\n}\n\nexport interface Inboxmessage {\n allowMessageDeletion: boolean;\n contentPreview: string;\n hasAttachments: boolean;\n id: number;\n isMessageRead: boolean;\n isReply: boolean;\n isReplyAllowed: boolean;\n sender: Messagesender;\n sentDateTime: string;\n subject: string;\n}\n\nexport interface Inbox {\n incomingMessages: Inboxmessage[];\n}\n\nexport interface ShortData {\n id: number;\n name: string;\n longname: string;\n orgname?: string;\n orgid?: number;\n}\n\nexport interface Lesson {\n id: number;\n date: number;\n startTime: number;\n endTime: number;\n kl: ShortData[];\n te: ShortData[];\n su: ShortData[];\n ro: ShortData[];\n lstext?: string;\n lsnumber: number;\n activityType?: 'Unterricht' | string;\n code?: 'cancelled' | 'irregular';\n info?: string;\n substText?: string;\n statflags?: string;\n sg?: string;\n bkRemark?: string;\n bkText?: string;\n}\n\nexport interface Homework {\n /**\n * Unknown type. I have never seen this in use.\n */\n attachments: Array;\n completed: boolean;\n date: number;\n dueDate: number;\n id: number;\n lessonId: number;\n remark: string;\n text: string;\n}\n\nexport interface Subject {\n id: number;\n name: string;\n longName: string;\n alternateName: string | '';\n active: boolean;\n foreColor: string;\n backColor: string;\n}\n\nexport enum WebUntisDay {\n Sunday = 1,\n Monday = 2,\n Tuesday = 3,\n Wednesday = 4,\n Thursday = 5,\n Friday = 6,\n Saturday = 7,\n}\n\nexport interface TimeUnit {\n name: string;\n startTime: number;\n endTime: number;\n}\n\nexport interface Timegrid {\n day: WebUntisDay;\n timeUnits: TimeUnit[];\n}\n\nexport interface Exam {\n id: number;\n examType: string;\n name: string;\n studentClass: string[];\n assignedStudents: {\n klasse: { id: number; name: string };\n displayName: string;\n id: number;\n }[];\n examDate: number;\n startTime: number;\n endTime: number;\n subject: string;\n teachers: string[];\n rooms: string[];\n text: string;\n grade?: string;\n}\n\nexport enum WebUntisElementType {\n CLASS = 1,\n TEACHER = 2,\n SUBJECT = 3,\n ROOM = 4,\n STUDENT = 5,\n}\n\nexport interface WebElement {\n type: WebUntisElementType;\n id: number;\n orgId: number;\n missing: boolean;\n state: 'REGULAR' | 'ABSENT' | 'SUBSTITUTED';\n}\n\nexport interface WebElementData extends WebElement {\n element: {\n type: number;\n id: number;\n name: string;\n longName?: string;\n displayname?: string;\n alternatename?: string;\n canViewTimetable: boolean;\n externalKey?: string;\n roomCapacity: number;\n };\n}\n\nexport interface WebAPITimetable {\n id: number;\n lessonId: number;\n lessonNumber: number;\n lessonCode: string;\n lessonText: string;\n periodText: string;\n hasPeriodText: false;\n periodInfo: string;\n periodAttachments: [];\n substText: string;\n date: number;\n startTime: number;\n endTime: number;\n elements: WebElement[];\n studentGroup: string;\n hasInfo: boolean;\n code: number;\n cellState: 'STANDARD' | 'SUBSTITUTION' | 'ROOMSUBSTITUTION';\n priority: number;\n is: {\n roomSubstitution?: boolean;\n substitution?: boolean;\n standard?: boolean;\n event: boolean;\n };\n roomCapacity: number;\n studentCount: number;\n classes: WebElementData[];\n teachers: WebElementData[];\n subjects: WebElementData[];\n rooms: WebElementData[];\n students: WebElementData[];\n}\n\nexport interface Teacher {\n id: number;\n name: string;\n foreName: string;\n longName: string;\n foreColor: string;\n backColor: string;\n}\n\nexport interface Student {\n id: number;\n key: number;\n name: string;\n foreName: string;\n longName: string;\n gender: string;\n}\n\nexport interface Room {\n id: number;\n name: string;\n longName: string;\n alternateName: string | '';\n active: boolean;\n foreColor: string;\n backColor: string;\n}\n\nexport interface Klasse {\n id: number;\n name: string;\n longName: string;\n active: boolean;\n foreColor?: string;\n backColor?: string;\n did?: number;\n teacher1?: number;\n teacher2?: number;\n}\n\nexport interface Department {\n id: number;\n name: string;\n longName: string;\n}\n\nexport interface Holiday {\n name: string;\n longName: string;\n id: number;\n startDate: number;\n endDate: number;\n}\n\nexport interface ColorEntity {\n foreColor: string;\n backColor: string;\n}\n\nexport interface LsEntity {\n ls?: ColorEntity | null;\n oh?: ColorEntity | null;\n sb?: ColorEntity | null;\n bs?: ColorEntity | null;\n ex?: ColorEntity | null;\n}\n\nexport interface CodesEntity {\n cancelled?: ColorEntity | null;\n irregular?: ColorEntity | null;\n}\n\nexport interface StatusData {\n lstypes: LsEntity[];\n codes: CodesEntity[];\n}\n\nexport interface Absences {\n absences: Absence[];\n absenceReasons: [];\n excuseStatuses: boolean;\n showAbsenceReasonChange: boolean;\n showCreateAbsence: boolean;\n}\n\nexport interface Absence {\n id: number;\n startDate: number;\n endDate: number;\n startTime: number;\n endTime: number;\n createDate: number;\n lastUpdate: number;\n createdUser: string;\n updatedUser: string;\n reasonId: number;\n reason: string;\n text: string;\n interruptions: [];\n canEdit: boolean;\n studentName: string;\n excuseStatus: string;\n isExcused: boolean;\n excuse: Excuse;\n}\n\nexport interface Excuse {\n id: number;\n text: string;\n excuseDate: number;\n excuseStatus: string;\n isExcused: boolean;\n userId: number;\n username: string;\n}\n","import { serialize } from './cookie';\nimport axios from 'axios';\nimport { btoa } from './base-64';\nimport { parse as fnsParse, startOfDay, format, type ParseOptions } from 'date-fns';\nimport type { AxiosInstance } from 'axios';\nimport type {\n Absences,\n Department,\n Exam,\n Holiday,\n Homework,\n Inbox,\n Klasse,\n Lesson,\n NewsWidget,\n Room,\n SchoolYear,\n StatusData,\n Student,\n Subject,\n Teacher,\n Timegrid,\n WebAPITimetable,\n} from './types';\nimport type { InternalSchoolYear, SessionInformation } from './internal';\nimport { WebUntisElementType } from './types';\n\n/**\n * Ensures that the dateStr is a string when calling {@link fnsParse}.\n * This is needed since some WebUntis servers return numbers instead of strings.\n * @param dateStr {string | number}\n * @param formatStr {string}\n * @param referenceDate {DateType | number | string}\n * @param options {ParseOptions | undefined}\n * @returns \n */\nconst parse = (\n dateStr: string | number,\n formatStr: string,\n referenceDate: DateType | number | string,\n options?: ParseOptions,\n) => {\n return fnsParse(`${dateStr}`, formatStr, referenceDate, options);\n};\n\nexport class Base {\n school: string;\n schoolbase64: string;\n username: string;\n password: string;\n baseurl: string;\n cookies: string[];\n id: string;\n sessionInformation: SessionInformation | null;\n anonymous: boolean;\n\n axios: AxiosInstance;\n\n static TYPES = WebUntisElementType;\n\n /**\n *\n * @constructor\n * @param {string} school The school identifier\n * @param {string} username\n * @param {string} password\n * @param {string} baseurl Just the host name of your WebUntis (Example: mese.webuntis.com)\n * @param {string} [identity=\"Awesome\"] A identity like: MyAwesomeApp\n * @param {boolean} [disableUserAgent=false] If this is true, axios will not send a custom User-Agent\n */\n constructor(\n school: string,\n username: string,\n password: string,\n baseurl: string,\n identity = 'Awesome',\n disableUserAgent = false,\n ) {\n this.school = school;\n this.schoolbase64 = '_' + btoa(this.school);\n this.username = username;\n this.password = password;\n this.baseurl = 'https://' + baseurl + '/';\n this.cookies = [];\n this.id = identity;\n this.sessionInformation = {};\n this.anonymous = false;\n\n const additionalHeaders: Record = {};\n\n if (!disableUserAgent) {\n additionalHeaders['User-Agent'] =\n 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3163.79 Safari/537.36';\n }\n\n this.axios = axios.create({\n baseURL: this.baseurl,\n maxRedirects: 0,\n headers: {\n 'Cache-Control': 'no-cache',\n Pragma: 'no-cache',\n 'X-Requested-With': 'XMLHttpRequest',\n ...additionalHeaders,\n },\n validateStatus: function (status) {\n return status >= 200 && status < 303; // default\n },\n });\n }\n\n /**\n * Logout the current session\n */\n async logout(): Promise {\n await this.axios({\n method: 'POST',\n url: `/WebUntis/jsonrpc.do`,\n params: {\n school: this.school,\n },\n data: {\n id: this.id,\n method: 'logout',\n params: {},\n jsonrpc: '2.0',\n },\n });\n this.sessionInformation = null;\n return true;\n }\n\n /**\n * Login with your credentials\n *\n * **Notice: The server may revoke this session after less than 10min of idle.**\n *\n * *Untis says in the official docs:*\n * > An application should always log out as soon as possible to free system resources on the server.\n */\n async login(): Promise {\n const response = await this.axios({\n method: 'POST',\n url: `/WebUntis/jsonrpc.do`,\n params: {\n school: this.school,\n },\n data: {\n id: this.id,\n method: 'authenticate',\n params: {\n user: this.username,\n password: this.password,\n client: this.id,\n },\n jsonrpc: '2.0',\n },\n });\n if (typeof response.data !== 'object') throw new Error('Failed to parse server response.');\n if (!response.data.result) throw new Error('Failed to login. ' + JSON.stringify(response.data));\n if (response.data.result.code) throw new Error('Login returned error code: ' + response.data.result.code);\n if (!response.data.result.sessionId) throw new Error('Failed to login. No session id.');\n this.sessionInformation = response.data.result;\n return response.data.result;\n }\n\n /**\n * Get the latest WebUntis Schoolyear\n * @param {Boolean} [validateSession=true]\n */\n async getLatestSchoolyear(validateSession = true): Promise {\n const data = await this._request('getSchoolyears', {}, validateSession);\n data.sort((a, b) => {\n const na = parse(a.startDate, 'yyyyMMdd', new Date());\n const nb = parse(b.startDate, 'yyyyMMdd', new Date());\n return nb.getTime() - na.getTime();\n });\n if (!data[0]) throw new Error('Failed to receive school year');\n return {\n name: data[0].name,\n id: data[0].id,\n startDate: parse(data[0].startDate, 'yyyyMMdd', new Date()),\n endDate: parse(data[0].endDate, 'yyyyMMdd', new Date()),\n };\n }\n\n /**\n * Get all WebUntis Schoolyears\n * @param {Boolean} [validateSession=true]\n */\n async getSchoolyears(validateSession = true): Promise {\n const data = await this._request('getSchoolyears', {}, validateSession);\n data.sort((a, b) => {\n const na = parse(a.startDate, 'yyyyMMdd', new Date());\n const nb = parse(b.startDate, 'yyyyMMdd', new Date());\n return nb.getTime() - na.getTime();\n });\n if (!data[0]) throw new Error('Failed to receive school year');\n return data.map((year) => {\n return {\n name: year.name,\n id: year.id,\n startDate: parse(year.startDate, 'yyyyMMdd', new Date()),\n endDate: parse(year.endDate, 'yyyyMMdd', new Date()),\n };\n });\n }\n\n /**\n * Get News Widget\n * @param {Date} date\n * @param {boolean} [validateSession=true]\n * @returns {Promise} see index.d.ts NewsWidget\n */\n async getNewsWidget(date: Date, validateSession = true): Promise {\n if (validateSession && !(await this.validateSession())) throw new Error('Current Session is not valid');\n const response = await this.axios({\n method: 'GET',\n url: `/WebUntis/api/public/news/newsWidgetData`,\n params: {\n date: Base.convertDateToUntis(date),\n },\n headers: {\n Cookie: this._buildCookies(),\n },\n });\n if (typeof response.data.data !== 'object') throw new Error('Server returned invalid data.');\n return response.data.data;\n }\n\n /**\n * Get Inbox\n */\n async getInbox(validateSession = true): Promise {\n this._checkAnonymous();\n if (validateSession && !(await this.validateSession())) throw new Error('Current Session is not valid');\n //first get JWT Token\n if (typeof this.sessionInformation!.jwt_token != 'string') await this._getJWT();\n const response = await this.axios({\n method: 'GET',\n url: `/WebUntis/api/rest/view/v1/messages`,\n headers: {\n Authorization: `Bearer ${this.sessionInformation!.jwt_token}`,\n Cookie: this._buildCookies(),\n },\n });\n if (typeof response.data !== 'object') throw new Error('Server returned invalid data.');\n return response.data;\n }\n\n private _checkAnonymous() {\n if (this.anonymous) {\n throw new Error('This method is not supported with anonymous login');\n }\n }\n\n /**\n *\n * @returns {string}\n * @private\n */\n _buildCookies() {\n let cookies = [];\n cookies.push(serialize('JSESSIONID', this.sessionInformation!.sessionId!));\n cookies.push(serialize('schoolname', this.schoolbase64));\n return cookies.join('; ');\n }\n\n /**\n * Get JWT Token\n * @private\n */\n async _getJWT(validateSession = true): Promise {\n if (validateSession && !(await this.validateSession())) throw new Error('Current Session is not valid');\n const response = await this.axios({\n method: 'GET',\n url: `/WebUntis/api/token/new`,\n headers: {\n //Authorization: `Bearer ${this._getToken()}`,\n Cookie: this._buildCookies(),\n },\n });\n\n if (typeof response.data !== 'string') throw new Error('Server returned invalid data.');\n this.sessionInformation!.jwt_token = response.data;\n return response.data;\n }\n\n /**\n * Checks if your current WebUntis Session is valid\n */\n async validateSession(): Promise {\n if (!this.sessionInformation) return false;\n const response = await this.axios({\n method: 'POST',\n url: `/WebUntis/jsonrpc.do`,\n params: {\n school: this.school,\n },\n headers: {\n Cookie: this._buildCookies(),\n },\n data: {\n id: this.id,\n method: 'getLatestImportTime',\n params: {},\n jsonrpc: '2.0',\n },\n });\n return typeof response.data.result === 'number';\n }\n\n /**\n * Get the time when WebUntis last changed its data\n * @param {Boolean} [validateSession=true]\n */\n async getLatestImportTime(validateSession = true): Promise {\n return this._request('getLatestImportTime', {}, validateSession);\n }\n\n /**\n *\n * @param id\n * @param type\n * @param startDate\n * @param endDate\n * @param validateSession\n * @private\n */\n private async _timetableRequest(\n id: string | number,\n type: number,\n startDate?: Date | null,\n endDate?: Date | null,\n validateSession = true,\n ): Promise {\n const additionalOptions: Record = {};\n if (startDate) {\n additionalOptions.startDate = Base.convertDateToUntis(startDate);\n }\n if (endDate) {\n additionalOptions.endDate = Base.convertDateToUntis(endDate);\n }\n\n return this._request(\n 'getTimetable',\n {\n options: {\n id: new Date().getTime(),\n element: {\n id,\n type,\n },\n ...additionalOptions,\n showLsText: true,\n showStudentgroup: true,\n showLsNumber: true,\n showSubstText: true,\n showInfo: true,\n showBooking: true,\n klasseFields: ['id', 'name', 'longname', 'externalkey'],\n roomFields: ['id', 'name', 'longname', 'externalkey'],\n subjectFields: ['id', 'name', 'longname', 'externalkey'],\n teacherFields: ['id', 'name', 'longname', 'externalkey'],\n },\n },\n validateSession,\n );\n }\n\n /**\n * Get your own Timetable for the current day\n * Note: You can't use this with anonymous login\n * @param {Boolean} [validateSession=true]\n * @returns {Promise}\n */\n async getOwnTimetableForToday(validateSession = true): Promise {\n this._checkAnonymous();\n return await this._timetableRequest(\n this.sessionInformation!.personId!,\n this.sessionInformation!.personType!,\n null,\n null,\n validateSession,\n );\n }\n\n /**\n * Get the timetable of today for a specific element.\n * @param {number} id\n * @param {WebUntisElementType} type\n * @param {Boolean} [validateSession=true]\n * @returns {Promise}\n */\n async getTimetableForToday(id: number, type: number, validateSession = true): Promise {\n return await this._timetableRequest(id, type, null, null, validateSession);\n }\n\n /**\n * Get your own Timetable for the given day\n * Note: You can't use this with anonymous login\n * @param {Date} date\n * @param {Boolean} [validateSession=true]\n */\n async getOwnTimetableFor(date: Date, validateSession = true): Promise {\n this._checkAnonymous();\n return await this._timetableRequest(\n this.sessionInformation!.personId!,\n this.sessionInformation!.personType!,\n date,\n date,\n validateSession,\n );\n }\n\n /**\n * Get the timetable for a specific day for a specific element.\n * @param {Date} date\n * @param {number} id\n * @param {WebUntisElementType} type\n * @param {Boolean} [validateSession=true]\n */\n async getTimetableFor(date: Date, id: number, type: number, validateSession = true): Promise {\n return await this._timetableRequest(id, type, date, date, validateSession);\n }\n\n /**\n * Get your own timetable for a given Date range\n * Note: You can't use this with anonymous login\n * @param {Date} rangeStart\n * @param {Date} rangeEnd\n * @param {Boolean} [validateSession=true]\n * @returns {Promise.}\n */\n async getOwnTimetableForRange(rangeStart: Date, rangeEnd: Date, validateSession = true): Promise {\n this._checkAnonymous();\n return await this._timetableRequest(\n this.sessionInformation!.personId!,\n this.sessionInformation!.personType!,\n rangeStart,\n rangeEnd,\n validateSession,\n );\n }\n\n /**\n * Get the timetable for a given Date range for specific element\n * @param {Date} rangeStart\n * @param {Date} rangeEnd\n * @param {number} id\n * @param {WebUntisElementType} type\n * @param {Boolean} [validateSession=true]\n */\n async getTimetableForRange(\n rangeStart: Date,\n rangeEnd: Date,\n id: number,\n type: number,\n validateSession = true,\n ): Promise {\n return await this._timetableRequest(id, type, rangeStart, rangeEnd, validateSession);\n }\n\n /**\n * Get the Timetable of your class for today\n * Note: You can't use this with anonymous login\n * @param {Boolean} [validateSession=true]\n * @returns {Promise}\n */\n async getOwnClassTimetableForToday(validateSession = true): Promise {\n this._checkAnonymous();\n return await this._timetableRequest(this.sessionInformation!.klasseId!, 1, null, null, validateSession);\n }\n\n /**\n * Get the Timetable of your class for the given day\n * Note: You can't use this with anonymous login\n * @param {Date} date\n * @param {Boolean} [validateSession=true]\n * @returns {Promise.}\n */\n async getOwnClassTimetableFor(date: Date, validateSession = true): Promise {\n this._checkAnonymous();\n return await this._timetableRequest(this.sessionInformation!.klasseId!, 1, date, date, validateSession);\n }\n\n /**\n * Get the Timetable of your class for a given Date range\n * Note: You can't use this with anonymous login\n * @param {Date} rangeStart\n * @param {Date} rangeEnd\n * @param {boolean} [validateSession=true]\n */\n async getOwnClassTimetableForRange(rangeStart: Date, rangeEnd: Date, validateSession = true): Promise {\n this._checkAnonymous();\n return await this._timetableRequest(\n this.sessionInformation!.klasseId!,\n 1,\n rangeStart,\n rangeEnd,\n validateSession,\n );\n }\n\n /**\n *\n * @param {Date} rangeStart\n * @param {Date} rangeEnd\n * @param {boolean} [validateSession=true]\n * @returns {Promise.}\n */\n async getHomeWorksFor(rangeStart: Date, rangeEnd: Date, validateSession = true): Promise {\n if (validateSession && !(await this.validateSession())) throw new Error('Current Session is not valid');\n const response = await this.axios({\n method: 'GET',\n url: `/WebUntis/api/homeworks/lessons`,\n params: {\n startDate: Base.convertDateToUntis(rangeStart),\n endDate: Base.convertDateToUntis(rangeEnd),\n },\n headers: {\n Cookie: this._buildCookies(),\n },\n });\n if (typeof response.data.data !== 'object') throw new Error('Server returned invalid data.');\n if (!response.data.data['homeworks']) throw new Error(\"Data object doesn't contains homeworks object.\");\n return response.data.data;\n }\n\n /**\n * Converts the untis date string format to a normal JS Date object\n * @param {string} date Untis date string\n * @param {Date} [baseDate=new Date()] Base date. Default beginning of current day\n * @static\n */\n static convertUntisDate(date: string, baseDate = startOfDay(new Date())): Date {\n if (typeof date !== 'string') date = `${date}`;\n return parse(date, 'yyyyMMdd', baseDate);\n }\n\n /**\n * Convert a untis time string to a JS Date object\n * @param {string|number} time Untis time string\n * @param {Date} [baseDate=new Date()] Day used as base for the time. Default: Current date\n * @static\n */\n static convertUntisTime(time: number | string, baseDate = new Date()): Date {\n if (typeof time !== 'string') time = `${time}`;\n return parse(time.padStart(4, '0'), 'Hmm', baseDate);\n }\n\n /**\n * Get all known Subjects for the current logged-in user\n * @param {boolean} [validateSession=true]\n */\n async getSubjects(validateSession = true): Promise {\n return await this._request('getSubjects', {}, validateSession);\n }\n\n /**\n * Get the timegrid of current school\n * @param {boolean} [validateSession=true]\n * @returns {Promise.}\n */\n async getTimegrid(validateSession = true): Promise {\n return await this._request('getTimegridUnits', {}, validateSession);\n }\n\n /**\n *\n * TODO: Find out what type this function returns\n * @param {Date} rangeStart\n * @param {Date} rangeEnd\n * @param {boolean} [validateSession=true]\n * @returns {Promise.}\n */\n async getHomeWorkAndLessons(rangeStart: Date, rangeEnd: Date, validateSession = true): Promise> {\n if (validateSession && !(await this.validateSession())) throw new Error('Current Session is not valid');\n const response = await this.axios({\n method: 'GET',\n url: `/WebUntis/api/homeworks/lessons`,\n params: {\n startDate: Base.convertDateToUntis(rangeStart),\n endDate: Base.convertDateToUntis(rangeEnd),\n },\n headers: {\n Cookie: this._buildCookies(),\n },\n });\n if (typeof response.data.data !== 'object') throw new Error('Server returned invalid data.');\n if (!response.data.data['homeworks']) throw new Error(\"Data object doesn't contains homeworks object.\");\n return response.data.data;\n }\n\n /**\n * Get Exams for range\n * @param {Date} rangeStart\n * @param {Date} rangeEnd\n * @param {Number} klasseId\n * @param {boolean} withGrades\n * @param {boolean} [validateSession=true]\n */\n async getExamsForRange(\n rangeStart: Date,\n rangeEnd: Date,\n klasseId = -1,\n withGrades = false,\n validateSession = true,\n ): Promise> {\n if (validateSession && !(await this.validateSession())) throw new Error('Current Session is not valid');\n const response = await this.axios({\n method: 'GET',\n url: `/WebUntis/api/exams`,\n params: {\n startDate: Base.convertDateToUntis(rangeStart),\n endDate: Base.convertDateToUntis(rangeEnd),\n klasseId: klasseId,\n withGrades: withGrades,\n },\n headers: {\n Cookie: this._buildCookies(),\n },\n });\n if (typeof response.data.data !== 'object') throw new Error('Server returned invalid data.');\n if (!response.data.data['exams']) throw new Error(\"Data object doesn't contains exams object.\");\n return response.data.data['exams'];\n }\n\n /**\n * Get the timetable for the current week for a specific element from the web client API.\n * @param {Date} date one date in the week to query\n * @param {number} id element id\n * @param {WebUntisElementType} type element type\n * @param {Number} [formatId=1] set to 1 to include teachers, 2 omits the teachers in elements response\n * @param {Boolean} [validateSession=true]\n */\n async getTimetableForWeek(\n date: Date,\n id: number,\n type: number,\n formatId = 1,\n validateSession = true,\n ): Promise {\n if (validateSession && !(await this.validateSession())) throw new Error('Current Session is not valid');\n\n const response = await this.axios({\n method: 'GET',\n url: `/WebUntis/api/public/timetable/weekly/data`,\n params: {\n elementType: type,\n elementId: id,\n date: format(date, 'yyyy-MM-dd'),\n formatId: formatId,\n },\n headers: {\n Cookie: this._buildCookies(),\n },\n });\n\n if (typeof response.data.data !== 'object') throw new Error('Server returned invalid data.');\n\n if (response.data.data.error) {\n /* known codes:\n * - ERR_TTVIEW_NOTALLOWED_ONDATE\n */\n const err = new Error('Server responded with error');\n // TODO: Make this better lol\n // @ts-ignore\n err.code = response.data.data.error?.data?.messageKey;\n throw err;\n }\n\n if (!response.data.data.result?.data?.elementPeriods?.[id]) throw new Error('Invalid response');\n\n const data = response.data.data.result.data;\n\n // TODO: improve typings\n\n const formatElements = (elements: Array>, { byType }: { byType: number }) => {\n const filteredElements = elements.filter((element) => element.type === byType);\n\n return filteredElements.map((element) => ({\n ...element,\n element: data.elements.find(\n (dataElement: Record) =>\n dataElement.type === byType && dataElement.id === element.id,\n ),\n }));\n };\n\n const timetable = data.elementPeriods[id].map((lesson: any) => ({\n ...lesson,\n classes: formatElements(lesson.elements, { byType: Base.TYPES.CLASS }),\n teachers: formatElements(lesson.elements, { byType: Base.TYPES.TEACHER }),\n subjects: formatElements(lesson.elements, { byType: Base.TYPES.SUBJECT }),\n rooms: formatElements(lesson.elements, { byType: Base.TYPES.ROOM }),\n students: formatElements(lesson.elements, { byType: Base.TYPES.STUDENT }),\n }));\n\n return timetable;\n }\n\n /**\n * Get the timetable for the current week for the current element from the web client API.\n * @param {Date} date one date in the week to query\n * @param {Number} [formatId=1] set to 1 to include teachers, 2 omits the teachers in elements response\n * @param {Boolean} [validateSession=true]\n * @returns {Promise}\n */\n async getOwnTimetableForWeek(date: Date, formatId = 1, validateSession = true): Promise {\n this._checkAnonymous();\n return await this.getTimetableForWeek(\n date,\n this.sessionInformation!.personId!,\n this.sessionInformation!.personType!,\n formatId,\n validateSession,\n );\n }\n\n /**\n * Get all known teachers by WebUntis\n * @param {boolean} [validateSession=true]\n * @returns {Promise.}\n */\n async getTeachers(validateSession = true): Promise {\n return await this._request('getTeachers', {}, validateSession);\n }\n\n /**\n * Get all known students by WebUntis\n * @param {boolean} [validateSession=true]\n * @returns {Promise.}\n */\n async getStudents(validateSession = true): Promise {\n return await this._request('getStudents', {}, validateSession);\n }\n\n /**\n * Get all known rooms by WebUntis\n * @param {boolean} [validateSession=true]\n * @returns {Promise.}\n */\n async getRooms(validateSession = true): Promise {\n return await this._request('getRooms', {}, validateSession);\n }\n\n /**\n * Get all classes known by WebUntis\n * @param {boolean} [validateSession=true]\n * @param {number} schoolyearId\n * @returns {Promise.}\n */\n async getClasses(validateSession = true, schoolyearId: number): Promise {\n const data = typeof schoolyearId !== 'number' ? {} : { schoolyearId };\n return await this._request('getKlassen', data, validateSession);\n }\n\n /**\n * Get all departments known by WebUntis\n * @param {boolean} [validateSession=true]\n * @returns {Promise.}\n */\n async getDepartments(validateSession = true): Promise {\n return await this._request('getDepartments', {}, validateSession);\n }\n\n /**\n * Get all holidays known by WebUntis\n * @param {boolean} [validateSession=true]\n * @returns {Promise.}\n */\n async getHolidays(validateSession = true): Promise {\n return await this._request('getHolidays', {}, validateSession);\n }\n\n /**\n * Get all status data known by WebUntis\n * @param {boolean} [validateSession=true]\n * @returns {Promise.}\n */\n async getStatusData(validateSession = true): Promise {\n return await this._request('getStatusData', {}, validateSession);\n }\n\n /**\n * Get the current school year\n * @param [validateSession=true]\n * @returns {Promise.}\n */\n async getCurrentSchoolyear(validateSession = true): Promise {\n const data = await this._request('getCurrentSchoolyear', {}, validateSession);\n\n if (!data) throw new Error('Failed to retrieve current school year');\n\n return {\n name: data.name,\n id: data.id,\n startDate: Base.convertUntisDate(data.startDate),\n endDate: Base.convertUntisDate(data.endDate),\n };\n }\n\n /**\n * Convert a JS Date Object to a WebUntis date string\n * @param {Date} date\n * @returns {String}\n */\n static convertDateToUntis(date: Date): string {\n return (\n date.getFullYear().toString() +\n (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1).toString() +\n (date.getDate() < 10 ? '0' + date.getDate() : date.getDate()).toString()\n );\n }\n\n /**\n * Make a JSON RPC Request with the current session\n * @param {string} method\n * @param {Object} [parameter={}]\n * @param {string} [url='/WebUntis/jsonrpc.do?school=SCHOOL']\n * @param {boolean} [validateSession=true] Whether the session should be checked first\n * @returns {Promise.}\n * @private\n */\n async _request>(\n method: string,\n parameter: Record = {},\n validateSession = true,\n url = `/WebUntis/jsonrpc.do`,\n ): Promise {\n if (validateSession && !(await this.validateSession())) throw new Error('Current Session is not valid');\n const response = await this.axios({\n method: 'POST',\n url: url,\n params: {\n school: this.school,\n },\n headers: {\n Cookie: this._buildCookies(),\n },\n data: {\n id: this.id,\n method: method,\n params: parameter,\n jsonrpc: '2.0',\n },\n });\n if (!response.data.result) throw new Error(\"Server didn't return any result.\");\n if (response.data.result.code) throw new Error('Server returned error code: ' + response.data.result.code);\n return response.data.result;\n }\n\n /**\n * Returns all the Lessons where you were absent including the excused one!\n * @param {Date} rangeStart\n * @param {Date} rangeEnd\n * @param {Integer} [excuseStatusId=-1]\n * @param {boolean} [validateSession=true]\n * @returns {Promise}\n */\n async getAbsentLesson(\n rangeStart: Date,\n rangeEnd: Date,\n excuseStatusId = -1,\n validateSession = true,\n ): Promise {\n if (validateSession && !(await this.validateSession())) throw new Error('Current Session is not valid');\n this._checkAnonymous();\n const response = await this.axios({\n method: 'GET',\n url: `/WebUntis/api/classreg/absences/students`,\n params: {\n startDate: Base.convertDateToUntis(rangeStart),\n endDate: Base.convertDateToUntis(rangeEnd),\n studentId: this.sessionInformation!.personId!,\n excuseStatusId: excuseStatusId,\n },\n headers: {\n Cookie: this._buildCookies(),\n },\n });\n if (response.data.data == null) throw new Error('Server returned no data!');\n return response.data.data;\n }\n\n /**\n * Returns a URL to a unique PDF of all the lessons you were absent\n * @param {Date} rangeStart\n * @param {Date} rangeEnd\n * @param {boolean} [validateSession=true]\n * @param {Integer} [excuseStatusId=-1]\n * @param {boolean} [lateness=true]\n * @param {boolean} [absences=true]\n * @param {boolean} [excuseGroup=2]\n */\n async getPdfOfAbsentLesson(\n rangeStart: Date,\n rangeEnd: Date,\n validateSession = true,\n excuseStatusId = -1,\n lateness = true,\n absences = true,\n excuseGroup = 2,\n ): Promise {\n if (validateSession && !(await this.validateSession())) throw new Error('Current Session is not valid');\n this._checkAnonymous();\n const response = await this.axios({\n method: 'GET',\n url: `/WebUntis/reports.do`,\n params: {\n name: 'Excuse',\n format: 'pdf',\n rpt_sd: Base.convertDateToUntis(rangeStart),\n rpt_ed: Base.convertDateToUntis(rangeEnd),\n excuseStatusId: excuseStatusId,\n studentId: this.sessionInformation!.personId!,\n withLateness: lateness,\n withAbsences: absences,\n execuseGroup: excuseGroup,\n },\n headers: {\n Cookie: this._buildCookies(),\n },\n });\n const res = response.data.data;\n if (response.status != 200 || res.error) throw new Error('Server returned no data!');\n const pdfDownloadURL =\n this.baseurl + 'WebUntis/reports.do?' + 'msgId=' + res.messageId + '&' + res.reportParams;\n return pdfDownloadURL;\n }\n}\n\n/**\n * @private\n */\nexport class InternalWebuntisSecretLogin extends Base {\n constructor(\n school: string,\n username: string,\n password: string,\n baseurl: string,\n identity = 'Awesome',\n disableUserAgent = false,\n ) {\n super(school, username, password, baseurl, identity, disableUserAgent);\n }\n\n async _otpLogin(token: number | string, username: string, time: number, skipSessionInfo = false) {\n const response = await this.axios({\n method: 'POST',\n url: '/WebUntis/jsonrpc_intern.do',\n params: {\n m: 'getUserData2017',\n school: this.school,\n v: 'i2.2',\n },\n data: {\n id: this.id,\n method: 'getUserData2017',\n params: [\n {\n auth: {\n clientTime: time,\n user: username,\n otp: token,\n },\n },\n ],\n jsonrpc: '2.0',\n },\n });\n if (response.data && response.data.error)\n throw new Error('Failed to login. ' + (response.data.error.message || ''));\n if (!response.headers['set-cookie']) throw new Error(`Failed to login. Server didn't return a set-cookie`);\n if (!this._getCookieFromSetCookie(response.headers['set-cookie']))\n throw new Error(\"Failed to login. Server didn't return a session id.\");\n const sessionId = this._getCookieFromSetCookie(response.headers['set-cookie']);\n // Set session temporary\n this.sessionInformation = {\n sessionId: sessionId,\n };\n if (skipSessionInfo) return this.sessionInformation;\n\n // Get personId & personType\n const appConfigUrl = `/WebUntis/api/app/config`;\n const configResponse = await this.axios({\n method: 'GET',\n url: appConfigUrl,\n headers: {\n Cookie: this._buildCookies(),\n },\n });\n if (typeof configResponse.data !== 'object' || typeof configResponse.data.data !== 'object')\n throw new Error('Failed to fetch app config while login. data (type): ' + typeof response.data);\n // Path -> data.loginServiceConfig.user.persons -> find person with id\n if (\n configResponse.data.data &&\n configResponse.data.data.loginServiceConfig &&\n configResponse.data.data.loginServiceConfig.user &&\n !Number.isInteger(configResponse.data.data.loginServiceConfig.user.personId)\n )\n throw new Error('Invalid personId. personId: ' + configResponse.data.data.loginServiceConfig.user.personId);\n const webUntisLoginServiceUser = configResponse.data.data.loginServiceConfig.user;\n if (!Array.isArray(webUntisLoginServiceUser.persons))\n throw new Error('Invalid person array. persons (type): ' + typeof webUntisLoginServiceUser.persons);\n const person = webUntisLoginServiceUser.persons.find(\n (value: Record) => value.id === configResponse.data.data.loginServiceConfig.user.personId,\n );\n if (!person) throw new Error('Can not find person in person array.');\n if (!Number.isInteger(person.type)) throw new Error('Invalid person type. type (type): ' + person.type);\n this.sessionInformation = {\n sessionId: sessionId,\n personType: person.type,\n personId: configResponse.data.data.loginServiceConfig.user.personId,\n };\n // Get klasseId\n try {\n const dayConfigUrl = `/WebUntis/api/daytimetable/config`;\n const dayConfigResponse = await this.axios({\n method: 'GET',\n url: dayConfigUrl,\n headers: {\n Cookie: this._buildCookies(),\n },\n });\n if (typeof dayConfigResponse.data !== 'object' || typeof dayConfigResponse.data.data !== 'object')\n throw new Error();\n if (!Number.isInteger(dayConfigResponse.data.data.klasseId)) throw new Error();\n this.sessionInformation = {\n sessionId: sessionId,\n personType: person.type,\n personId: configResponse.data.data.loginServiceConfig.user.personId,\n klasseId: dayConfigResponse.data.data.klasseId,\n };\n } catch (e) {\n // klasseId is not important. This request can fail\n }\n return this.sessionInformation;\n }\n\n /**\n *\n * @param {Array} setCookieArray\n * @param {string} [cookieName=\"JSESSIONID\"]\n * @return {string|boolean}\n * @private\n */\n _getCookieFromSetCookie(setCookieArray?: string[], cookieName = 'JSESSIONID') {\n if (!setCookieArray) return;\n for (let i = 0; i < setCookieArray.length; i++) {\n const setCookie = setCookieArray[i];\n if (!setCookie) continue;\n let cookieParts = setCookie.split(';');\n if (!cookieParts || !Array.isArray(cookieParts)) continue;\n for (let cookie of cookieParts) {\n cookie = cookie.trim();\n cookie = cookie.replace(/;/gm, '');\n const [Key, Value] = cookie.split('=');\n if (!Key || !Value) continue;\n if (Key === cookieName) return Value;\n }\n }\n }\n}\n","import { InternalWebuntisSecretLogin } from './base';\nimport type { authenticator } from 'otplib';\n\nexport type Authenticator = typeof authenticator;\n\nexport class WebUntisSecretAuth extends InternalWebuntisSecretLogin {\n private readonly secret: string;\n private authenticator: Authenticator;\n\n /**\n *\n * @constructor\n * @augments WebUntis\n * @param {string} school The school identifier\n * @param {string} user\n * @param {string} secret\n * @param {string} baseurl Just the host name of your WebUntis (Example: mese.webuntis.com)\n * @param {string} [identity=\"Awesome\"] A identity like: MyAwesomeApp\n * @param {Object} authenticator Custom otplib v12 instance. Default will use the default otplib configuration.\n * @param {boolean} [disableUserAgent=false] If this is true, axios will not send a custom User-Agent\n */\n constructor(\n school: string,\n user: string,\n secret: string,\n baseurl: string,\n identity = 'Awesome',\n authenticator: Authenticator,\n disableUserAgent = false,\n ) {\n super(school, user, null as unknown as string, baseurl, identity, disableUserAgent);\n this.secret = secret;\n this.authenticator = authenticator;\n if (!authenticator) {\n if ('import' in globalThis) {\n throw new Error(\n 'You need to provide the otplib object by yourself. We can not eval the require in ESM mode.',\n );\n }\n // React-Native will not eval this expression\n const { authenticator } = eval(\"require('otplib')\");\n this.authenticator = authenticator;\n }\n }\n\n // @ts-ignore\n async login() {\n // Get JSESSION\n const token = this.authenticator.generate(this.secret);\n const time = new Date().getTime();\n return await this._otpLogin(token, this.username, time);\n }\n}\n","import { WebUntisSecretAuth } from './secret';\nimport type { Authenticator } from './secret';\nimport type { URL } from 'url';\n\n/**\n * @private\n */\nexport type URLClass = typeof URL;\n\nexport class WebUntisQR extends WebUntisSecretAuth {\n /**\n * Use the data you get from a WebUntis QR code\n * @constructor\n * @param {string} QRCodeURI A WebUntis uri. This is the data you get from the QR Code from the webuntis webapp under profile->Data access->Display\n * @param {string} [identity=\"Awesome\"] A identity like: MyAwesomeApp\n * @param {Object} authenticator Custom otplib v12 instance. Default will use the default otplib configuration.\n * @param {Object} URL Custom whatwg url implementation. Default will use the nodejs implementation.\n * @param {boolean} [disableUserAgent=false] If this is true, axios will not send a custom User-Agent\n */\n constructor(\n QRCodeURI: string,\n identity: string,\n authenticator: Authenticator,\n URL?: URLClass,\n disableUserAgent = false,\n ) {\n let URLImplementation = URL;\n if (!URL) {\n if ('import' in globalThis) {\n throw new Error(\n 'You need to provide the URL object by yourself. We can not eval the require in ESM mode.',\n );\n }\n // React-Native will not eval this expression\n URLImplementation = eval(\"require('url').URL\") as URLClass;\n }\n const uri = new URLImplementation!(QRCodeURI);\n super(\n uri.searchParams.get('school')!,\n uri.searchParams.get('user')!,\n uri.searchParams.get('key')!,\n uri.searchParams.get('url')!,\n identity,\n authenticator,\n disableUserAgent,\n );\n }\n}\n","import { InternalWebuntisSecretLogin } from './base';\n\nexport class WebUntisAnonymousAuth extends InternalWebuntisSecretLogin {\n /**\n *\n * @param {string} school\n * @param {string} baseurl\n * @param {string} [identity='Awesome']\n * @param {boolean} [disableUserAgent=false] If this is true, axios will not send a custom User-Agent\n */\n constructor(school: string, baseurl: string, identity = 'Awesome', disableUserAgent = false) {\n // TODO: Make this a bit more beautiful and more type safe\n super(school, null as unknown as string, null as unknown as string, baseurl, identity, disableUserAgent);\n this.username = '#anonymous#';\n this.anonymous = true;\n }\n\n override async login() {\n // Check whether the school has public access or not\n const url = `/WebUntis/jsonrpc_intern.do`;\n\n const response = await this.axios({\n method: 'POST',\n url,\n params: {\n m: 'getAppSharedSecret',\n school: this.school,\n v: 'i3.5',\n },\n data: {\n id: this.id,\n method: 'getAppSharedSecret',\n params: [\n {\n userName: '#anonymous#',\n password: '',\n },\n ],\n jsonrpc: '2.0',\n },\n });\n\n if (response.data && response.data.error)\n throw new Error('Failed to login. ' + (response.data.error.message || ''));\n\n // OTP never changes when using anonymous login\n const otp = 100170;\n const time = new Date().getTime();\n return await this._otpLogin(otp, this.username, time, true);\n }\n}\n"],"names":["WebUntisDay","WebUntisElementType","fnsParse","__publicField","startOfDay","format"],"mappings":";;;;;AAkBA,MAAM,kBAAqB,GAAA,uCAAA,CAAA;AA0DpB,SAAS,SAAU,CAAA,IAAA,EAAc,GAAa,EAAA,GAAA,GAAwB,EAAY,EAAA;AACrF,EAAA,IAAI,CAAC,GAAI,CAAA,MAAA;AAAQ,IAAA,GAAA,CAAI,MAAS,GAAA,kBAAA,CAAA;AAE9B,EAAI,IAAA,CAAC,kBAAmB,CAAA,IAAA,CAAK,IAAI,CAAA;AAAG,IAAM,MAAA,IAAI,UAAU,0BAA0B,CAAA,CAAA;AAElF,EAAM,MAAA,KAAA,GAAQ,GAAI,CAAA,MAAA,CAAO,GAAG,CAAA,CAAA;AAE5B,EAAA,IAAI,KAAS,IAAA,CAAC,kBAAmB,CAAA,IAAA,CAAK,KAAK,CAAA;AAAG,IAAM,MAAA,IAAI,UAAU,yBAAyB,CAAA,CAAA;AAE3F,EAAI,IAAA,GAAA,GAAM,OAAO,GAAM,GAAA,KAAA,CAAA;AAEvB,EAAI,IAAA,IAAA,IAAQ,IAAI,MAAQ,EAAA;AACpB,IAAM,MAAA,MAAA,GAAS,IAAI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M,GAAA,CAAA,2BAAA,CAAA,CAAA;AAEZ,IAAM,MAAA,QAAA,GAAW,MAAM,IAAA,CAAK,KAAM,CAAA;AAAA,MAC9B,MAAQ,EAAA,MAAA;AAAA,MACR,GAAA;AAAA,MACA,MAAQ,EAAA;AAAA,QACJ,CAAG,EAAA,oBAAA;AAAA,QACH,QAAQ,IAAK,CAAA,MAAA;AAAA,QACb,CAAG,EAAA,MAAA;AAAA,OACP;AAAA,MACA,IAAM,EAAA;AAAA,QACF,IAAI,IAAK,CAAA,EAAA;AAAA,QACT,MAAQ,EAAA,oBAAA;AAAA,QACR,MAAQ,EAAA;AAAA,UACJ;AAAA,YACI,QAAU,EAAA,aAAA;AAAA,YACV,QAAU,EAAA,EAAA;AAAA,WACd;AAAA,SACJ;AAAA,QACA,OAAS,EAAA,KAAA;AAAA,OACb;AAAA,KACH,CAAA,CAAA;AAED,IAAI,IAAA,QAAA,CAAS,IAAQ,IAAA,QAAA,CAAS,IAAK,CAAA,KAAA;AAC/B,MAAA,MAAM,IAAI,KAAM,CAAA,mBAAA,IAAuB,SAAS,IAAK,CAAA,KAAA,CAAM,WAAW,EAAG,CAAA,CAAA,CAAA;AAG7E,IAAA,MAAM,GAAM,GAAA,MAAA,CAAA;AACZ,IAAA,MAAM,IAAO,GAAA,iBAAA,IAAI,IAAK,EAAA,EAAE,OAAQ,EAAA,CAAA;AAChC,IAAA,OAAO,MAAM,IAAK,CAAA,SAAA,CAAU,KAAK,IAAK,CAAA,QAAA,EAAU,MAAM,IAAI,CAAA,CAAA;AAAA,GAC9D;AACJ;;;;;;;;;;;"} \ No newline at end of file diff --git a/dist/webuntis.mjs b/dist/webuntis.mjs index f953d71..5c42907 100644 --- a/dist/webuntis.mjs +++ b/dist/webuntis.mjs @@ -1,5 +1,5 @@ import axios from 'axios'; -import { parse, startOfDay, format } from 'date-fns'; +import { startOfDay, format, parse as parse$1 } from 'date-fns'; const fieldContentRegExp = /^[\u0009\u0020-\u007e\u0080-\u00ff]+$/; function serialize(name, val, opt = {}) { @@ -92,6 +92,9 @@ var __publicField$1 = (obj, key, value) => { __defNormalProp$1(obj, typeof key !== "symbol" ? key + "" : key, value); return value; }; +const parse = (dateStr, formatStr, referenceDate, options) => { + return parse$1(`${dateStr}`, formatStr, referenceDate, options); +}; const _Base = class _Base { /** * diff --git a/dist/webuntis.mjs.map b/dist/webuntis.mjs.map index 71ccb93..b55d96b 100644 --- a/dist/webuntis.mjs.map +++ b/dist/webuntis.mjs.map @@ -1 +1 @@ -{"version":3,"file":"webuntis.mjs","sources":["../src/cookie.ts","../src/base-64.ts","../src/types.ts","../src/base.ts","../src/secret.ts","../src/qr.ts","../src/anonymous.ts"],"sourcesContent":["/**\n * Shamelessly stolen from @tinyhttp/cookie.\n *\n * Because @tinyhttp/cookie doesn't provide a commonjs build, I just decided to include the source code.\n * We need a cjs build, because we generate both esm and cjs.\n */\n\nconst pairSplitRegExp = /; */;\n\n/**\n * RegExp to match field-content in RFC 7230 sec 3.2\n *\n * field-content = field-vchar [ 1*( SP / HTAB ) field-vchar ]\n * field-vchar = VCHAR / obs-text\n * obs-text = %x80-FF\n */\n\n// eslint-disable-next-line no-control-regex\nconst fieldContentRegExp = /^[\\u0009\\u0020-\\u007e\\u0080-\\u00ff]+$/;\n\nfunction tryDecode(str: string, decode: (str: string) => string) {\n try {\n return decode(str);\n } catch (e) {\n return str;\n }\n}\n\n/**\n * Parse a cookie header.\n *\n * Parse the given cookie header string into an object\n * The object has the various cookies as keys(names) => values\n *\n */\nexport function parse(\n str: string,\n options: {\n decode: (str: string) => string;\n } = {\n decode: decodeURIComponent,\n },\n): Record {\n const obj: Record = {};\n const pairs = str.split(pairSplitRegExp);\n\n for (const pair of pairs) {\n let eqIdx = pair.indexOf('=');\n\n // skip things that don't look like key=value\n if (eqIdx < 0) continue;\n\n const key = pair.substr(0, eqIdx).trim();\n let val = pair.substr(++eqIdx, pair.length).trim();\n\n // quoted values\n if ('\"' == val[0]) val = val.slice(1, -1);\n\n // only assign once\n if (obj[key] == null) obj[key] = tryDecode(val, options.decode);\n }\n\n return obj;\n}\n\nexport type SerializeOptions = Partial<{\n encode: (str: string) => string;\n maxAge: number;\n domain: string;\n path: string;\n httpOnly: boolean;\n secure: boolean;\n sameSite: boolean | 'Strict' | 'strict' | 'Lax' | 'lax' | 'None' | 'none' | string;\n expires: Date;\n}>;\n\nexport function serialize(name: string, val: string, opt: SerializeOptions = {}): string {\n if (!opt.encode) opt.encode = encodeURIComponent;\n\n if (!fieldContentRegExp.test(name)) throw new TypeError('argument name is invalid');\n\n const value = opt.encode(val);\n\n if (value && !fieldContentRegExp.test(value)) throw new TypeError('argument val is invalid');\n\n let str = name + '=' + value;\n\n if (null != opt.maxAge) {\n const maxAge = opt.maxAge - 0;\n\n if (isNaN(maxAge) || !isFinite(maxAge)) throw new TypeError('option maxAge is invalid');\n\n str += '; Max-Age=' + Math.floor(maxAge);\n }\n\n if (opt.domain) {\n if (!fieldContentRegExp.test(opt.domain)) throw new TypeError('option domain is invalid');\n\n str += '; Domain=' + opt.domain;\n }\n\n if (opt.path) {\n if (!fieldContentRegExp.test(opt.path)) throw new TypeError('option path is invalid');\n\n str += '; Path=' + opt.path;\n }\n\n if (opt.expires) str += '; Expires=' + opt.expires.toUTCString();\n\n if (opt.httpOnly) str += '; HttpOnly';\n\n if (opt.secure) str += '; Secure';\n\n if (opt.sameSite) {\n const sameSite = typeof opt.sameSite === 'string' ? opt.sameSite.toLowerCase() : opt.sameSite;\n\n switch (sameSite) {\n case true:\n case 'strict':\n str += '; SameSite=Strict';\n break;\n case 'lax':\n str += '; SameSite=Lax';\n break;\n case 'none':\n str += '; SameSite=None';\n break;\n default:\n throw new TypeError('option sameSite is invalid');\n }\n }\n\n return str;\n}\n","const chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';\nexport function btoa(input = '') {\n let str = input;\n let output = '';\n\n for (\n let block = 0, charCode, i = 0, map = chars;\n str.charAt(i | 0) || ((map = '='), i % 1);\n output += map.charAt(63 & (block >> (8 - (i % 1) * 8)))\n ) {\n charCode = str.charCodeAt((i += 3 / 4));\n\n if (charCode > 0xff) {\n throw new Error(\"'btoa' failed: The string to be encoded contains characters outside of the Latin1 range.\");\n }\n\n block = (block << 8) | charCode;\n }\n\n return output;\n}\n","export interface SchoolYear {\n name: string;\n id: number;\n startDate: Date;\n endDate: Date;\n}\n\nexport interface MessagesOfDay {\n id: number;\n subject: string;\n text: string;\n isExpanded: boolean;\n /**\n * Unknown type. I have never seen this in use.\n */\n attachments: any[];\n}\n\nexport interface NewsWidget {\n /**\n * Unknown type. I have never seen this in use.\n */\n systemMessage: any;\n messagesOfDay: MessagesOfDay[];\n rssUrl: string;\n}\n\nexport interface Messagesender {\n userId: number;\n displayName: string;\n imageUrl: string;\n className: string;\n}\n\nexport interface Inboxmessage {\n allowMessageDeletion: boolean;\n contentPreview: string;\n hasAttachments: boolean;\n id: number;\n isMessageRead: boolean;\n isReply: boolean;\n isReplyAllowed: boolean;\n sender: Messagesender;\n sentDateTime: string;\n subject: string;\n}\n\nexport interface Inbox {\n incomingMessages: Inboxmessage[];\n}\n\nexport interface ShortData {\n id: number;\n name: string;\n longname: string;\n orgname?: string;\n orgid?: number;\n}\n\nexport interface Lesson {\n id: number;\n date: number;\n startTime: number;\n endTime: number;\n kl: ShortData[];\n te: ShortData[];\n su: ShortData[];\n ro: ShortData[];\n lstext?: string;\n lsnumber: number;\n activityType?: 'Unterricht' | string;\n code?: 'cancelled' | 'irregular';\n info?: string;\n substText?: string;\n statflags?: string;\n sg?: string;\n bkRemark?: string;\n bkText?: string;\n}\n\nexport interface Homework {\n /**\n * Unknown type. I have never seen this in use.\n */\n attachments: Array;\n completed: boolean;\n date: number;\n dueDate: number;\n id: number;\n lessonId: number;\n remark: string;\n text: string;\n}\n\nexport interface Subject {\n id: number;\n name: string;\n longName: string;\n alternateName: string | '';\n active: boolean;\n foreColor: string;\n backColor: string;\n}\n\nexport enum WebUntisDay {\n Sunday = 1,\n Monday = 2,\n Tuesday = 3,\n Wednesday = 4,\n Thursday = 5,\n Friday = 6,\n Saturday = 7,\n}\n\nexport interface TimeUnit {\n name: string;\n startTime: number;\n endTime: number;\n}\n\nexport interface Timegrid {\n day: WebUntisDay;\n timeUnits: TimeUnit[];\n}\n\nexport interface Exam {\n id: number;\n examType: string;\n name: string;\n studentClass: string[];\n assignedStudents: {\n klasse: { id: number; name: string };\n displayName: string;\n id: number;\n }[];\n examDate: number;\n startTime: number;\n endTime: number;\n subject: string;\n teachers: string[];\n rooms: string[];\n text: string;\n grade?: string;\n}\n\nexport enum WebUntisElementType {\n CLASS = 1,\n TEACHER = 2,\n SUBJECT = 3,\n ROOM = 4,\n STUDENT = 5,\n}\n\nexport interface WebElement {\n type: WebUntisElementType;\n id: number;\n orgId: number;\n missing: boolean;\n state: 'REGULAR' | 'ABSENT' | 'SUBSTITUTED';\n}\n\nexport interface WebElementData extends WebElement {\n element: {\n type: number;\n id: number;\n name: string;\n longName?: string;\n displayname?: string;\n alternatename?: string;\n canViewTimetable: boolean;\n externalKey?: string;\n roomCapacity: number;\n };\n}\n\nexport interface WebAPITimetable {\n id: number;\n lessonId: number;\n lessonNumber: number;\n lessonCode: string;\n lessonText: string;\n periodText: string;\n hasPeriodText: false;\n periodInfo: string;\n periodAttachments: [];\n substText: string;\n date: number;\n startTime: number;\n endTime: number;\n elements: WebElement[];\n studentGroup: string;\n hasInfo: boolean;\n code: number;\n cellState: 'STANDARD' | 'SUBSTITUTION' | 'ROOMSUBSTITUTION';\n priority: number;\n is: {\n roomSubstitution?: boolean;\n substitution?: boolean;\n standard?: boolean;\n event: boolean;\n };\n roomCapacity: number;\n studentCount: number;\n classes: WebElementData[];\n teachers: WebElementData[];\n subjects: WebElementData[];\n rooms: WebElementData[];\n students: WebElementData[];\n}\n\nexport interface Teacher {\n id: number;\n name: string;\n foreName: string;\n longName: string;\n foreColor: string;\n backColor: string;\n}\n\nexport interface Student {\n id: number;\n key: number;\n name: string;\n foreName: string;\n longName: string;\n gender: string;\n}\n\nexport interface Room {\n id: number;\n name: string;\n longName: string;\n alternateName: string | '';\n active: boolean;\n foreColor: string;\n backColor: string;\n}\n\nexport interface Klasse {\n id: number;\n name: string;\n longName: string;\n active: boolean;\n foreColor?: string;\n backColor?: string;\n did?: number;\n teacher1?: number;\n teacher2?: number;\n}\n\nexport interface Department {\n id: number;\n name: string;\n longName: string;\n}\n\nexport interface Holiday {\n name: string;\n longName: string;\n id: number;\n startDate: number;\n endDate: number;\n}\n\nexport interface ColorEntity {\n foreColor: string;\n backColor: string;\n}\n\nexport interface LsEntity {\n ls?: ColorEntity | null;\n oh?: ColorEntity | null;\n sb?: ColorEntity | null;\n bs?: ColorEntity | null;\n ex?: ColorEntity | null;\n}\n\nexport interface CodesEntity {\n cancelled?: ColorEntity | null;\n irregular?: ColorEntity | null;\n}\n\nexport interface StatusData {\n lstypes: LsEntity[];\n codes: CodesEntity[];\n}\n\nexport interface Absences {\n absences: Absence[];\n absenceReasons: [];\n excuseStatuses: boolean;\n showAbsenceReasonChange: boolean;\n showCreateAbsence: boolean;\n}\n\nexport interface Absence {\n id: number;\n startDate: number;\n endDate: number;\n startTime: number;\n endTime: number;\n createDate: number;\n lastUpdate: number;\n createdUser: string;\n updatedUser: string;\n reasonId: number;\n reason: string;\n text: string;\n interruptions: [];\n canEdit: boolean;\n studentName: string;\n excuseStatus: string;\n isExcused: boolean;\n excuse: Excuse;\n}\n\nexport interface Excuse {\n id: number;\n text: string;\n excuseDate: number;\n excuseStatus: string;\n isExcused: boolean;\n userId: number;\n username: string;\n}\n","import { serialize } from './cookie';\nimport axios from 'axios';\nimport { btoa } from './base-64';\nimport { parse, startOfDay, format } from 'date-fns';\nimport type { AxiosInstance } from 'axios';\nimport type {\n Absences,\n Department,\n Exam,\n Holiday,\n Homework,\n Inbox,\n Klasse,\n Lesson,\n NewsWidget,\n Room,\n SchoolYear,\n StatusData,\n Student,\n Subject,\n Teacher,\n Timegrid,\n WebAPITimetable,\n} from './types';\nimport type { InternalSchoolYear, SessionInformation } from './internal';\nimport { WebUntisElementType } from './types';\n\nexport class Base {\n school: string;\n schoolbase64: string;\n username: string;\n password: string;\n baseurl: string;\n cookies: string[];\n id: string;\n sessionInformation: SessionInformation | null;\n anonymous: boolean;\n\n axios: AxiosInstance;\n\n static TYPES = WebUntisElementType;\n\n /**\n *\n * @constructor\n * @param {string} school The school identifier\n * @param {string} username\n * @param {string} password\n * @param {string} baseurl Just the host name of your WebUntis (Example: mese.webuntis.com)\n * @param {string} [identity=\"Awesome\"] A identity like: MyAwesomeApp\n * @param {boolean} [disableUserAgent=false] If this is true, axios will not send a custom User-Agent\n */\n constructor(\n school: string,\n username: string,\n password: string,\n baseurl: string,\n identity = 'Awesome',\n disableUserAgent = false,\n ) {\n this.school = school;\n this.schoolbase64 = '_' + btoa(this.school);\n this.username = username;\n this.password = password;\n this.baseurl = 'https://' + baseurl + '/';\n this.cookies = [];\n this.id = identity;\n this.sessionInformation = {};\n this.anonymous = false;\n\n const additionalHeaders: Record = {};\n\n if (!disableUserAgent) {\n additionalHeaders['User-Agent'] =\n 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3163.79 Safari/537.36';\n }\n\n this.axios = axios.create({\n baseURL: this.baseurl,\n maxRedirects: 0,\n headers: {\n 'Cache-Control': 'no-cache',\n Pragma: 'no-cache',\n 'X-Requested-With': 'XMLHttpRequest',\n ...additionalHeaders,\n },\n validateStatus: function (status) {\n return status >= 200 && status < 303; // default\n },\n });\n }\n\n /**\n * Logout the current session\n */\n async logout(): Promise {\n await this.axios({\n method: 'POST',\n url: `/WebUntis/jsonrpc.do`,\n params: {\n school: this.school,\n },\n data: {\n id: this.id,\n method: 'logout',\n params: {},\n jsonrpc: '2.0',\n },\n });\n this.sessionInformation = null;\n return true;\n }\n\n /**\n * Login with your credentials\n *\n * **Notice: The server may revoke this session after less than 10min of idle.**\n *\n * *Untis says in the official docs:*\n * > An application should always log out as soon as possible to free system resources on the server.\n */\n async login(): Promise {\n const response = await this.axios({\n method: 'POST',\n url: `/WebUntis/jsonrpc.do`,\n params: {\n school: this.school,\n },\n data: {\n id: this.id,\n method: 'authenticate',\n params: {\n user: this.username,\n password: this.password,\n client: this.id,\n },\n jsonrpc: '2.0',\n },\n });\n if (typeof response.data !== 'object') throw new Error('Failed to parse server response.');\n if (!response.data.result) throw new Error('Failed to login. ' + JSON.stringify(response.data));\n if (response.data.result.code) throw new Error('Login returned error code: ' + response.data.result.code);\n if (!response.data.result.sessionId) throw new Error('Failed to login. No session id.');\n this.sessionInformation = response.data.result;\n return response.data.result;\n }\n\n /**\n * Get the latest WebUntis Schoolyear\n * @param {Boolean} [validateSession=true]\n */\n async getLatestSchoolyear(validateSession = true): Promise {\n const data = await this._request('getSchoolyears', {}, validateSession);\n data.sort((a, b) => {\n const na = parse(a.startDate, 'yyyyMMdd', new Date());\n const nb = parse(b.startDate, 'yyyyMMdd', new Date());\n return nb.getTime() - na.getTime();\n });\n if (!data[0]) throw new Error('Failed to receive school year');\n return {\n name: data[0].name,\n id: data[0].id,\n startDate: parse(data[0].startDate, 'yyyyMMdd', new Date()),\n endDate: parse(data[0].endDate, 'yyyyMMdd', new Date()),\n };\n }\n\n /**\n * Get all WebUntis Schoolyears\n * @param {Boolean} [validateSession=true]\n */\n async getSchoolyears(validateSession = true): Promise {\n const data = await this._request('getSchoolyears', {}, validateSession);\n data.sort((a, b) => {\n const na = parse(a.startDate, 'yyyyMMdd', new Date());\n const nb = parse(b.startDate, 'yyyyMMdd', new Date());\n return nb.getTime() - na.getTime();\n });\n if (!data[0]) throw new Error('Failed to receive school year');\n return data.map((year) => {\n return {\n name: year.name,\n id: year.id,\n startDate: parse(year.startDate, 'yyyyMMdd', new Date()),\n endDate: parse(year.endDate, 'yyyyMMdd', new Date()),\n };\n });\n }\n\n /**\n * Get News Widget\n * @param {Date} date\n * @param {boolean} [validateSession=true]\n * @returns {Promise} see index.d.ts NewsWidget\n */\n async getNewsWidget(date: Date, validateSession = true): Promise {\n if (validateSession && !(await this.validateSession())) throw new Error('Current Session is not valid');\n const response = await this.axios({\n method: 'GET',\n url: `/WebUntis/api/public/news/newsWidgetData`,\n params: {\n date: Base.convertDateToUntis(date),\n },\n headers: {\n Cookie: this._buildCookies(),\n },\n });\n if (typeof response.data.data !== 'object') throw new Error('Server returned invalid data.');\n return response.data.data;\n }\n\n /**\n * Get Inbox\n */\n async getInbox(validateSession = true): Promise {\n this._checkAnonymous();\n if (validateSession && !(await this.validateSession())) throw new Error('Current Session is not valid');\n //first get JWT Token\n if (typeof this.sessionInformation!.jwt_token != 'string') await this._getJWT();\n const response = await this.axios({\n method: 'GET',\n url: `/WebUntis/api/rest/view/v1/messages`,\n headers: {\n Authorization: `Bearer ${this.sessionInformation!.jwt_token}`,\n Cookie: this._buildCookies(),\n },\n });\n if (typeof response.data !== 'object') throw new Error('Server returned invalid data.');\n return response.data;\n }\n\n private _checkAnonymous() {\n if (this.anonymous) {\n throw new Error('This method is not supported with anonymous login');\n }\n }\n\n /**\n *\n * @returns {string}\n * @private\n */\n _buildCookies() {\n let cookies = [];\n cookies.push(serialize('JSESSIONID', this.sessionInformation!.sessionId!));\n cookies.push(serialize('schoolname', this.schoolbase64));\n return cookies.join('; ');\n }\n\n /**\n * Get JWT Token\n * @private\n */\n async _getJWT(validateSession = true): Promise {\n if (validateSession && !(await this.validateSession())) throw new Error('Current Session is not valid');\n const response = await this.axios({\n method: 'GET',\n url: `/WebUntis/api/token/new`,\n headers: {\n //Authorization: `Bearer ${this._getToken()}`,\n Cookie: this._buildCookies(),\n },\n });\n\n if (typeof response.data !== 'string') throw new Error('Server returned invalid data.');\n this.sessionInformation!.jwt_token = response.data;\n return response.data;\n }\n\n /**\n * Checks if your current WebUntis Session is valid\n */\n async validateSession(): Promise {\n if (!this.sessionInformation) return false;\n const response = await this.axios({\n method: 'POST',\n url: `/WebUntis/jsonrpc.do`,\n params: {\n school: this.school,\n },\n headers: {\n Cookie: this._buildCookies(),\n },\n data: {\n id: this.id,\n method: 'getLatestImportTime',\n params: {},\n jsonrpc: '2.0',\n },\n });\n return typeof response.data.result === 'number';\n }\n\n /**\n * Get the time when WebUntis last changed its data\n * @param {Boolean} [validateSession=true]\n */\n async getLatestImportTime(validateSession = true): Promise {\n return this._request('getLatestImportTime', {}, validateSession);\n }\n\n /**\n *\n * @param id\n * @param type\n * @param startDate\n * @param endDate\n * @param validateSession\n * @private\n */\n private async _timetableRequest(\n id: string | number,\n type: number,\n startDate?: Date | null,\n endDate?: Date | null,\n validateSession = true,\n ): Promise {\n const additionalOptions: Record = {};\n if (startDate) {\n additionalOptions.startDate = Base.convertDateToUntis(startDate);\n }\n if (endDate) {\n additionalOptions.endDate = Base.convertDateToUntis(endDate);\n }\n\n return this._request(\n 'getTimetable',\n {\n options: {\n id: new Date().getTime(),\n element: {\n id,\n type,\n },\n ...additionalOptions,\n showLsText: true,\n showStudentgroup: true,\n showLsNumber: true,\n showSubstText: true,\n showInfo: true,\n showBooking: true,\n klasseFields: ['id', 'name', 'longname', 'externalkey'],\n roomFields: ['id', 'name', 'longname', 'externalkey'],\n subjectFields: ['id', 'name', 'longname', 'externalkey'],\n teacherFields: ['id', 'name', 'longname', 'externalkey'],\n },\n },\n validateSession,\n );\n }\n\n /**\n * Get your own Timetable for the current day\n * Note: You can't use this with anonymous login\n * @param {Boolean} [validateSession=true]\n * @returns {Promise}\n */\n async getOwnTimetableForToday(validateSession = true): Promise {\n this._checkAnonymous();\n return await this._timetableRequest(\n this.sessionInformation!.personId!,\n this.sessionInformation!.personType!,\n null,\n null,\n validateSession,\n );\n }\n\n /**\n * Get the timetable of today for a specific element.\n * @param {number} id\n * @param {WebUntisElementType} type\n * @param {Boolean} [validateSession=true]\n * @returns {Promise}\n */\n async getTimetableForToday(id: number, type: number, validateSession = true): Promise {\n return await this._timetableRequest(id, type, null, null, validateSession);\n }\n\n /**\n * Get your own Timetable for the given day\n * Note: You can't use this with anonymous login\n * @param {Date} date\n * @param {Boolean} [validateSession=true]\n */\n async getOwnTimetableFor(date: Date, validateSession = true): Promise {\n this._checkAnonymous();\n return await this._timetableRequest(\n this.sessionInformation!.personId!,\n this.sessionInformation!.personType!,\n date,\n date,\n validateSession,\n );\n }\n\n /**\n * Get the timetable for a specific day for a specific element.\n * @param {Date} date\n * @param {number} id\n * @param {WebUntisElementType} type\n * @param {Boolean} [validateSession=true]\n */\n async getTimetableFor(date: Date, id: number, type: number, validateSession = true): Promise {\n return await this._timetableRequest(id, type, date, date, validateSession);\n }\n\n /**\n * Get your own timetable for a given Date range\n * Note: You can't use this with anonymous login\n * @param {Date} rangeStart\n * @param {Date} rangeEnd\n * @param {Boolean} [validateSession=true]\n * @returns {Promise.}\n */\n async getOwnTimetableForRange(rangeStart: Date, rangeEnd: Date, validateSession = true): Promise {\n this._checkAnonymous();\n return await this._timetableRequest(\n this.sessionInformation!.personId!,\n this.sessionInformation!.personType!,\n rangeStart,\n rangeEnd,\n validateSession,\n );\n }\n\n /**\n * Get the timetable for a given Date range for specific element\n * @param {Date} rangeStart\n * @param {Date} rangeEnd\n * @param {number} id\n * @param {WebUntisElementType} type\n * @param {Boolean} [validateSession=true]\n */\n async getTimetableForRange(\n rangeStart: Date,\n rangeEnd: Date,\n id: number,\n type: number,\n validateSession = true,\n ): Promise {\n return await this._timetableRequest(id, type, rangeStart, rangeEnd, validateSession);\n }\n\n /**\n * Get the Timetable of your class for today\n * Note: You can't use this with anonymous login\n * @param {Boolean} [validateSession=true]\n * @returns {Promise}\n */\n async getOwnClassTimetableForToday(validateSession = true): Promise {\n this._checkAnonymous();\n return await this._timetableRequest(this.sessionInformation!.klasseId!, 1, null, null, validateSession);\n }\n\n /**\n * Get the Timetable of your class for the given day\n * Note: You can't use this with anonymous login\n * @param {Date} date\n * @param {Boolean} [validateSession=true]\n * @returns {Promise.}\n */\n async getOwnClassTimetableFor(date: Date, validateSession = true): Promise {\n this._checkAnonymous();\n return await this._timetableRequest(this.sessionInformation!.klasseId!, 1, date, date, validateSession);\n }\n\n /**\n * Get the Timetable of your class for a given Date range\n * Note: You can't use this with anonymous login\n * @param {Date} rangeStart\n * @param {Date} rangeEnd\n * @param {boolean} [validateSession=true]\n */\n async getOwnClassTimetableForRange(rangeStart: Date, rangeEnd: Date, validateSession = true): Promise {\n this._checkAnonymous();\n return await this._timetableRequest(\n this.sessionInformation!.klasseId!,\n 1,\n rangeStart,\n rangeEnd,\n validateSession,\n );\n }\n\n /**\n *\n * @param {Date} rangeStart\n * @param {Date} rangeEnd\n * @param {boolean} [validateSession=true]\n * @returns {Promise.}\n */\n async getHomeWorksFor(rangeStart: Date, rangeEnd: Date, validateSession = true): Promise {\n if (validateSession && !(await this.validateSession())) throw new Error('Current Session is not valid');\n const response = await this.axios({\n method: 'GET',\n url: `/WebUntis/api/homeworks/lessons`,\n params: {\n startDate: Base.convertDateToUntis(rangeStart),\n endDate: Base.convertDateToUntis(rangeEnd),\n },\n headers: {\n Cookie: this._buildCookies(),\n },\n });\n if (typeof response.data.data !== 'object') throw new Error('Server returned invalid data.');\n if (!response.data.data['homeworks']) throw new Error(\"Data object doesn't contains homeworks object.\");\n return response.data.data;\n }\n\n /**\n * Converts the untis date string format to a normal JS Date object\n * @param {string} date Untis date string\n * @param {Date} [baseDate=new Date()] Base date. Default beginning of current day\n * @static\n */\n static convertUntisDate(date: string, baseDate = startOfDay(new Date())): Date {\n if (typeof date !== 'string') date = `${date}`;\n return parse(date, 'yyyyMMdd', baseDate);\n }\n\n /**\n * Convert a untis time string to a JS Date object\n * @param {string|number} time Untis time string\n * @param {Date} [baseDate=new Date()] Day used as base for the time. Default: Current date\n * @static\n */\n static convertUntisTime(time: number | string, baseDate = new Date()): Date {\n if (typeof time !== 'string') time = `${time}`;\n return parse(time.padStart(4, '0'), 'Hmm', baseDate);\n }\n\n /**\n * Get all known Subjects for the current logged-in user\n * @param {boolean} [validateSession=true]\n */\n async getSubjects(validateSession = true): Promise {\n return await this._request('getSubjects', {}, validateSession);\n }\n\n /**\n * Get the timegrid of current school\n * @param {boolean} [validateSession=true]\n * @returns {Promise.}\n */\n async getTimegrid(validateSession = true): Promise {\n return await this._request('getTimegridUnits', {}, validateSession);\n }\n\n /**\n *\n * TODO: Find out what type this function returns\n * @param {Date} rangeStart\n * @param {Date} rangeEnd\n * @param {boolean} [validateSession=true]\n * @returns {Promise.}\n */\n async getHomeWorkAndLessons(rangeStart: Date, rangeEnd: Date, validateSession = true): Promise> {\n if (validateSession && !(await this.validateSession())) throw new Error('Current Session is not valid');\n const response = await this.axios({\n method: 'GET',\n url: `/WebUntis/api/homeworks/lessons`,\n params: {\n startDate: Base.convertDateToUntis(rangeStart),\n endDate: Base.convertDateToUntis(rangeEnd),\n },\n headers: {\n Cookie: this._buildCookies(),\n },\n });\n if (typeof response.data.data !== 'object') throw new Error('Server returned invalid data.');\n if (!response.data.data['homeworks']) throw new Error(\"Data object doesn't contains homeworks object.\");\n return response.data.data;\n }\n\n /**\n * Get Exams for range\n * @param {Date} rangeStart\n * @param {Date} rangeEnd\n * @param {Number} klasseId\n * @param {boolean} withGrades\n * @param {boolean} [validateSession=true]\n */\n async getExamsForRange(\n rangeStart: Date,\n rangeEnd: Date,\n klasseId = -1,\n withGrades = false,\n validateSession = true,\n ): Promise> {\n if (validateSession && !(await this.validateSession())) throw new Error('Current Session is not valid');\n const response = await this.axios({\n method: 'GET',\n url: `/WebUntis/api/exams`,\n params: {\n startDate: Base.convertDateToUntis(rangeStart),\n endDate: Base.convertDateToUntis(rangeEnd),\n klasseId: klasseId,\n withGrades: withGrades,\n },\n headers: {\n Cookie: this._buildCookies(),\n },\n });\n if (typeof response.data.data !== 'object') throw new Error('Server returned invalid data.');\n if (!response.data.data['exams']) throw new Error(\"Data object doesn't contains exams object.\");\n return response.data.data['exams'];\n }\n\n /**\n * Get the timetable for the current week for a specific element from the web client API.\n * @param {Date} date one date in the week to query\n * @param {number} id element id\n * @param {WebUntisElementType} type element type\n * @param {Number} [formatId=1] set to 1 to include teachers, 2 omits the teachers in elements response\n * @param {Boolean} [validateSession=true]\n */\n async getTimetableForWeek(\n date: Date,\n id: number,\n type: number,\n formatId = 1,\n validateSession = true,\n ): Promise {\n if (validateSession && !(await this.validateSession())) throw new Error('Current Session is not valid');\n\n const response = await this.axios({\n method: 'GET',\n url: `/WebUntis/api/public/timetable/weekly/data`,\n params: {\n elementType: type,\n elementId: id,\n date: format(date, 'yyyy-MM-dd'),\n formatId: formatId,\n },\n headers: {\n Cookie: this._buildCookies(),\n },\n });\n\n if (typeof response.data.data !== 'object') throw new Error('Server returned invalid data.');\n\n if (response.data.data.error) {\n /* known codes:\n * - ERR_TTVIEW_NOTALLOWED_ONDATE\n */\n const err = new Error('Server responded with error');\n // TODO: Make this better lol\n // @ts-ignore\n err.code = response.data.data.error?.data?.messageKey;\n throw err;\n }\n\n if (!response.data.data.result?.data?.elementPeriods?.[id]) throw new Error('Invalid response');\n\n const data = response.data.data.result.data;\n\n // TODO: improve typings\n\n const formatElements = (elements: Array>, { byType }: { byType: number }) => {\n const filteredElements = elements.filter((element) => element.type === byType);\n\n return filteredElements.map((element) => ({\n ...element,\n element: data.elements.find(\n (dataElement: Record) =>\n dataElement.type === byType && dataElement.id === element.id,\n ),\n }));\n };\n\n const timetable = data.elementPeriods[id].map((lesson: any) => ({\n ...lesson,\n classes: formatElements(lesson.elements, { byType: Base.TYPES.CLASS }),\n teachers: formatElements(lesson.elements, { byType: Base.TYPES.TEACHER }),\n subjects: formatElements(lesson.elements, { byType: Base.TYPES.SUBJECT }),\n rooms: formatElements(lesson.elements, { byType: Base.TYPES.ROOM }),\n students: formatElements(lesson.elements, { byType: Base.TYPES.STUDENT }),\n }));\n\n return timetable;\n }\n\n /**\n * Get the timetable for the current week for the current element from the web client API.\n * @param {Date} date one date in the week to query\n * @param {Number} [formatId=1] set to 1 to include teachers, 2 omits the teachers in elements response\n * @param {Boolean} [validateSession=true]\n * @returns {Promise}\n */\n async getOwnTimetableForWeek(date: Date, formatId = 1, validateSession = true): Promise {\n this._checkAnonymous();\n return await this.getTimetableForWeek(\n date,\n this.sessionInformation!.personId!,\n this.sessionInformation!.personType!,\n formatId,\n validateSession,\n );\n }\n\n /**\n * Get all known teachers by WebUntis\n * @param {boolean} [validateSession=true]\n * @returns {Promise.}\n */\n async getTeachers(validateSession = true): Promise {\n return await this._request('getTeachers', {}, validateSession);\n }\n\n /**\n * Get all known students by WebUntis\n * @param {boolean} [validateSession=true]\n * @returns {Promise.}\n */\n async getStudents(validateSession = true): Promise {\n return await this._request('getStudents', {}, validateSession);\n }\n\n /**\n * Get all known rooms by WebUntis\n * @param {boolean} [validateSession=true]\n * @returns {Promise.}\n */\n async getRooms(validateSession = true): Promise {\n return await this._request('getRooms', {}, validateSession);\n }\n\n /**\n * Get all classes known by WebUntis\n * @param {boolean} [validateSession=true]\n * @param {number} schoolyearId\n * @returns {Promise.}\n */\n async getClasses(validateSession = true, schoolyearId: number): Promise {\n const data = typeof schoolyearId !== 'number' ? {} : { schoolyearId };\n return await this._request('getKlassen', data, validateSession);\n }\n\n /**\n * Get all departments known by WebUntis\n * @param {boolean} [validateSession=true]\n * @returns {Promise.}\n */\n async getDepartments(validateSession = true): Promise {\n return await this._request('getDepartments', {}, validateSession);\n }\n\n /**\n * Get all holidays known by WebUntis\n * @param {boolean} [validateSession=true]\n * @returns {Promise.}\n */\n async getHolidays(validateSession = true): Promise {\n return await this._request('getHolidays', {}, validateSession);\n }\n\n /**\n * Get all status data known by WebUntis\n * @param {boolean} [validateSession=true]\n * @returns {Promise.}\n */\n async getStatusData(validateSession = true): Promise {\n return await this._request('getStatusData', {}, validateSession);\n }\n\n /**\n * Get the current school year\n * @param [validateSession=true]\n * @returns {Promise.}\n */\n async getCurrentSchoolyear(validateSession = true): Promise {\n const data = await this._request('getCurrentSchoolyear', {}, validateSession);\n\n if (!data) throw new Error('Failed to retrieve current school year');\n\n return {\n name: data.name,\n id: data.id,\n startDate: Base.convertUntisDate(data.startDate),\n endDate: Base.convertUntisDate(data.endDate),\n };\n }\n\n /**\n * Convert a JS Date Object to a WebUntis date string\n * @param {Date} date\n * @returns {String}\n */\n static convertDateToUntis(date: Date): string {\n return (\n date.getFullYear().toString() +\n (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1).toString() +\n (date.getDate() < 10 ? '0' + date.getDate() : date.getDate()).toString()\n );\n }\n\n /**\n * Make a JSON RPC Request with the current session\n * @param {string} method\n * @param {Object} [parameter={}]\n * @param {string} [url='/WebUntis/jsonrpc.do?school=SCHOOL']\n * @param {boolean} [validateSession=true] Whether the session should be checked first\n * @returns {Promise.}\n * @private\n */\n async _request>(\n method: string,\n parameter: Record = {},\n validateSession = true,\n url = `/WebUntis/jsonrpc.do`,\n ): Promise {\n if (validateSession && !(await this.validateSession())) throw new Error('Current Session is not valid');\n const response = await this.axios({\n method: 'POST',\n url: url,\n params: {\n school: this.school,\n },\n headers: {\n Cookie: this._buildCookies(),\n },\n data: {\n id: this.id,\n method: method,\n params: parameter,\n jsonrpc: '2.0',\n },\n });\n if (!response.data.result) throw new Error(\"Server didn't return any result.\");\n if (response.data.result.code) throw new Error('Server returned error code: ' + response.data.result.code);\n return response.data.result;\n }\n\n /**\n * Returns all the Lessons where you were absent including the excused one!\n * @param {Date} rangeStart\n * @param {Date} rangeEnd\n * @param {Integer} [excuseStatusId=-1]\n * @param {boolean} [validateSession=true]\n * @returns {Promise}\n */\n async getAbsentLesson(\n rangeStart: Date,\n rangeEnd: Date,\n excuseStatusId = -1,\n validateSession = true,\n ): Promise {\n if (validateSession && !(await this.validateSession())) throw new Error('Current Session is not valid');\n this._checkAnonymous();\n const response = await this.axios({\n method: 'GET',\n url: `/WebUntis/api/classreg/absences/students`,\n params: {\n startDate: Base.convertDateToUntis(rangeStart),\n endDate: Base.convertDateToUntis(rangeEnd),\n studentId: this.sessionInformation!.personId!,\n excuseStatusId: excuseStatusId,\n },\n headers: {\n Cookie: this._buildCookies(),\n },\n });\n if (response.data.data == null) throw new Error('Server returned no data!');\n return response.data.data;\n }\n\n /**\n * Returns a URL to a unique PDF of all the lessons you were absent\n * @param {Date} rangeStart\n * @param {Date} rangeEnd\n * @param {boolean} [validateSession=true]\n * @param {Integer} [excuseStatusId=-1]\n * @param {boolean} [lateness=true]\n * @param {boolean} [absences=true]\n * @param {boolean} [excuseGroup=2]\n */\n async getPdfOfAbsentLesson(\n rangeStart: Date,\n rangeEnd: Date,\n validateSession = true,\n excuseStatusId = -1,\n lateness = true,\n absences = true,\n excuseGroup = 2,\n ): Promise {\n if (validateSession && !(await this.validateSession())) throw new Error('Current Session is not valid');\n this._checkAnonymous();\n const response = await this.axios({\n method: 'GET',\n url: `/WebUntis/reports.do`,\n params: {\n name: 'Excuse',\n format: 'pdf',\n rpt_sd: Base.convertDateToUntis(rangeStart),\n rpt_ed: Base.convertDateToUntis(rangeEnd),\n excuseStatusId: excuseStatusId,\n studentId: this.sessionInformation!.personId!,\n withLateness: lateness,\n withAbsences: absences,\n execuseGroup: excuseGroup,\n },\n headers: {\n Cookie: this._buildCookies(),\n },\n });\n const res = response.data.data;\n if (response.status != 200 || res.error) throw new Error('Server returned no data!');\n const pdfDownloadURL =\n this.baseurl + 'WebUntis/reports.do?' + 'msgId=' + res.messageId + '&' + res.reportParams;\n return pdfDownloadURL;\n }\n}\n\n/**\n * @private\n */\nexport class InternalWebuntisSecretLogin extends Base {\n constructor(\n school: string,\n username: string,\n password: string,\n baseurl: string,\n identity = 'Awesome',\n disableUserAgent = false,\n ) {\n super(school, username, password, baseurl, identity, disableUserAgent);\n }\n\n async _otpLogin(token: number | string, username: string, time: number, skipSessionInfo = false) {\n const response = await this.axios({\n method: 'POST',\n url: '/WebUntis/jsonrpc_intern.do',\n params: {\n m: 'getUserData2017',\n school: this.school,\n v: 'i2.2',\n },\n data: {\n id: this.id,\n method: 'getUserData2017',\n params: [\n {\n auth: {\n clientTime: time,\n user: username,\n otp: token,\n },\n },\n ],\n jsonrpc: '2.0',\n },\n });\n if (response.data && response.data.error)\n throw new Error('Failed to login. ' + (response.data.error.message || ''));\n if (!response.headers['set-cookie']) throw new Error(`Failed to login. Server didn't return a set-cookie`);\n if (!this._getCookieFromSetCookie(response.headers['set-cookie']))\n throw new Error(\"Failed to login. Server didn't return a session id.\");\n const sessionId = this._getCookieFromSetCookie(response.headers['set-cookie']);\n // Set session temporary\n this.sessionInformation = {\n sessionId: sessionId,\n };\n if (skipSessionInfo) return this.sessionInformation;\n\n // Get personId & personType\n const appConfigUrl = `/WebUntis/api/app/config`;\n const configResponse = await this.axios({\n method: 'GET',\n url: appConfigUrl,\n headers: {\n Cookie: this._buildCookies(),\n },\n });\n if (typeof configResponse.data !== 'object' || typeof configResponse.data.data !== 'object')\n throw new Error('Failed to fetch app config while login. data (type): ' + typeof response.data);\n // Path -> data.loginServiceConfig.user.persons -> find person with id\n if (\n configResponse.data.data &&\n configResponse.data.data.loginServiceConfig &&\n configResponse.data.data.loginServiceConfig.user &&\n !Number.isInteger(configResponse.data.data.loginServiceConfig.user.personId)\n )\n throw new Error('Invalid personId. personId: ' + configResponse.data.data.loginServiceConfig.user.personId);\n const webUntisLoginServiceUser = configResponse.data.data.loginServiceConfig.user;\n if (!Array.isArray(webUntisLoginServiceUser.persons))\n throw new Error('Invalid person array. persons (type): ' + typeof webUntisLoginServiceUser.persons);\n const person = webUntisLoginServiceUser.persons.find(\n (value: Record) => value.id === configResponse.data.data.loginServiceConfig.user.personId,\n );\n if (!person) throw new Error('Can not find person in person array.');\n if (!Number.isInteger(person.type)) throw new Error('Invalid person type. type (type): ' + person.type);\n this.sessionInformation = {\n sessionId: sessionId,\n personType: person.type,\n personId: configResponse.data.data.loginServiceConfig.user.personId,\n };\n // Get klasseId\n try {\n const dayConfigUrl = `/WebUntis/api/daytimetable/config`;\n const dayConfigResponse = await this.axios({\n method: 'GET',\n url: dayConfigUrl,\n headers: {\n Cookie: this._buildCookies(),\n },\n });\n if (typeof dayConfigResponse.data !== 'object' || typeof dayConfigResponse.data.data !== 'object')\n throw new Error();\n if (!Number.isInteger(dayConfigResponse.data.data.klasseId)) throw new Error();\n this.sessionInformation = {\n sessionId: sessionId,\n personType: person.type,\n personId: configResponse.data.data.loginServiceConfig.user.personId,\n klasseId: dayConfigResponse.data.data.klasseId,\n };\n } catch (e) {\n // klasseId is not important. This request can fail\n }\n return this.sessionInformation;\n }\n\n /**\n *\n * @param {Array} setCookieArray\n * @param {string} [cookieName=\"JSESSIONID\"]\n * @return {string|boolean}\n * @private\n */\n _getCookieFromSetCookie(setCookieArray?: string[], cookieName = 'JSESSIONID') {\n if (!setCookieArray) return;\n for (let i = 0; i < setCookieArray.length; i++) {\n const setCookie = setCookieArray[i];\n if (!setCookie) continue;\n let cookieParts = setCookie.split(';');\n if (!cookieParts || !Array.isArray(cookieParts)) continue;\n for (let cookie of cookieParts) {\n cookie = cookie.trim();\n cookie = cookie.replace(/;/gm, '');\n const [Key, Value] = cookie.split('=');\n if (!Key || !Value) continue;\n if (Key === cookieName) return Value;\n }\n }\n }\n}\n","import { InternalWebuntisSecretLogin } from './base';\nimport type { authenticator } from 'otplib';\n\nexport type Authenticator = typeof authenticator;\n\nexport class WebUntisSecretAuth extends InternalWebuntisSecretLogin {\n private readonly secret: string;\n private authenticator: Authenticator;\n\n /**\n *\n * @constructor\n * @augments WebUntis\n * @param {string} school The school identifier\n * @param {string} user\n * @param {string} secret\n * @param {string} baseurl Just the host name of your WebUntis (Example: mese.webuntis.com)\n * @param {string} [identity=\"Awesome\"] A identity like: MyAwesomeApp\n * @param {Object} authenticator Custom otplib v12 instance. Default will use the default otplib configuration.\n * @param {boolean} [disableUserAgent=false] If this is true, axios will not send a custom User-Agent\n */\n constructor(\n school: string,\n user: string,\n secret: string,\n baseurl: string,\n identity = 'Awesome',\n authenticator: Authenticator,\n disableUserAgent = false,\n ) {\n super(school, user, null as unknown as string, baseurl, identity, disableUserAgent);\n this.secret = secret;\n this.authenticator = authenticator;\n if (!authenticator) {\n if ('import' in globalThis) {\n throw new Error(\n 'You need to provide the otplib object by yourself. We can not eval the require in ESM mode.',\n );\n }\n // React-Native will not eval this expression\n const { authenticator } = eval(\"require('otplib')\");\n this.authenticator = authenticator;\n }\n }\n\n // @ts-ignore\n async login() {\n // Get JSESSION\n const token = this.authenticator.generate(this.secret);\n const time = new Date().getTime();\n return await this._otpLogin(token, this.username, time);\n }\n}\n","import { WebUntisSecretAuth } from './secret';\nimport type { Authenticator } from './secret';\nimport type { URL } from 'url';\n\n/**\n * @private\n */\nexport type URLClass = typeof URL;\n\nexport class WebUntisQR extends WebUntisSecretAuth {\n /**\n * Use the data you get from a WebUntis QR code\n * @constructor\n * @param {string} QRCodeURI A WebUntis uri. This is the data you get from the QR Code from the webuntis webapp under profile->Data access->Display\n * @param {string} [identity=\"Awesome\"] A identity like: MyAwesomeApp\n * @param {Object} authenticator Custom otplib v12 instance. Default will use the default otplib configuration.\n * @param {Object} URL Custom whatwg url implementation. Default will use the nodejs implementation.\n * @param {boolean} [disableUserAgent=false] If this is true, axios will not send a custom User-Agent\n */\n constructor(\n QRCodeURI: string,\n identity: string,\n authenticator: Authenticator,\n URL?: URLClass,\n disableUserAgent = false,\n ) {\n let URLImplementation = URL;\n if (!URL) {\n if ('import' in globalThis) {\n throw new Error(\n 'You need to provide the URL object by yourself. We can not eval the require in ESM mode.',\n );\n }\n // React-Native will not eval this expression\n URLImplementation = eval(\"require('url').URL\") as URLClass;\n }\n const uri = new URLImplementation!(QRCodeURI);\n super(\n uri.searchParams.get('school')!,\n uri.searchParams.get('user')!,\n uri.searchParams.get('key')!,\n uri.searchParams.get('url')!,\n identity,\n authenticator,\n disableUserAgent,\n );\n }\n}\n","import { InternalWebuntisSecretLogin } from './base';\n\nexport class WebUntisAnonymousAuth extends InternalWebuntisSecretLogin {\n /**\n *\n * @param {string} school\n * @param {string} baseurl\n * @param {string} [identity='Awesome']\n * @param {boolean} [disableUserAgent=false] If this is true, axios will not send a custom User-Agent\n */\n constructor(school: string, baseurl: string, identity = 'Awesome', disableUserAgent = false) {\n // TODO: Make this a bit more beautiful and more type safe\n super(school, null as unknown as string, null as unknown as string, baseurl, identity, disableUserAgent);\n this.username = '#anonymous#';\n this.anonymous = true;\n }\n\n override async login() {\n // Check whether the school has public access or not\n const url = `/WebUntis/jsonrpc_intern.do`;\n\n const response = await this.axios({\n method: 'POST',\n url,\n params: {\n m: 'getAppSharedSecret',\n school: this.school,\n v: 'i3.5',\n },\n data: {\n id: this.id,\n method: 'getAppSharedSecret',\n params: [\n {\n userName: '#anonymous#',\n password: '',\n },\n ],\n jsonrpc: '2.0',\n },\n });\n\n if (response.data && response.data.error)\n throw new Error('Failed to login. ' + (response.data.error.message || ''));\n\n // OTP never changes when using anonymous login\n const otp = 100170;\n const time = new Date().getTime();\n return await this._otpLogin(otp, this.username, time, true);\n }\n}\n"],"names":["WebUntisDay","WebUntisElementType","__publicField"],"mappings":";;;AAkBA,MAAM,kBAAqB,GAAA,uCAAA,CAAA;AA0DpB,SAAS,SAAU,CAAA,IAAA,EAAc,GAAa,EAAA,GAAA,GAAwB,EAAY,EAAA;AACrF,EAAA,IAAI,CAAC,GAAI,CAAA,MAAA;AAAQ,IAAA,GAAA,CAAI,MAAS,GAAA,kBAAA,CAAA;AAE9B,EAAI,IAAA,CAAC,kBAAmB,CAAA,IAAA,CAAK,IAAI,CAAA;AAAG,IAAM,MAAA,IAAI,UAAU,0BAA0B,CAAA,CAAA;AAElF,EAAM,MAAA,KAAA,GAAQ,GAAI,CAAA,MAAA,CAAO,GAAG,CAAA,CAAA;AAE5B,EAAA,IAAI,KAAS,IAAA,CAAC,kBAAmB,CAAA,IAAA,CAAK,KAAK,CAAA;AAAG,IAAM,MAAA,IAAI,UAAU,yBAAyB,CAAA,CAAA;AAE3F,EAAI,IAAA,GAAA,GAAM,OAAO,GAAM,GAAA,KAAA,CAAA;AAEvB,EAAI,IAAA,IAAA,IAAQ,IAAI,MAAQ,EAAA;AACpB,IAAM,MAAA,MAAA,GAAS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,CAAG,EAAA,oBAAA;AAAA,QACH,QAAQ,IAAK,CAAA,MAAA;AAAA,QACb,CAAG,EAAA,MAAA;AAAA,OACP;AAAA,MACA,IAAM,EAAA;AAAA,QACF,IAAI,IAAK,CAAA,EAAA;AAAA,QACT,MAAQ,EAAA,oBAAA;AAAA,QACR,MAAQ,EAAA;AAAA,UACJ;AAAA,YACI,QAAU,EAAA,aAAA;AAAA,YACV,QAAU,EAAA,EAAA;AAAA,WACd;AAAA,SACJ;AAAA,QACA,OAAS,EAAA,KAAA;AAAA,OACb;AAAA,KACH,CAAA,CAAA;AAED,IAAI,IAAA,QAAA,CAAS,IAAQ,IAAA,QAAA,CAAS,IAAK,CAAA,KAAA;AAC/B,MAAA,MAAM,IAAI,KAAM,CAAA,mBAAA,IAAuB,SAAS,IAAK,CAAA,KAAA,CAAM,WAAW,EAAG,CAAA,CAAA,CAAA;AAG7E,IAAA,MAAM,GAAM,GAAA,MAAA,CAAA;AACZ,IAAA,MAAM,IAAO,GAAA,iBAAA,IAAI,IAAK,EAAA,EAAE,OAAQ,EAAA,CAAA;AAChC,IAAA,OAAO,MAAM,IAAK,CAAA,SAAA,CAAU,KAAK,IAAK,CAAA,QAAA,EAAU,MAAM,IAAI,CAAA,CAAA;AAAA,GAC9D;AACJ;;;;"} \ No newline at end of file +{"version":3,"file":"webuntis.mjs","sources":["../src/cookie.ts","../src/base-64.ts","../src/types.ts","../src/base.ts","../src/secret.ts","../src/qr.ts","../src/anonymous.ts"],"sourcesContent":["/**\n * Shamelessly stolen from @tinyhttp/cookie.\n *\n * Because @tinyhttp/cookie doesn't provide a commonjs build, I just decided to include the source code.\n * We need a cjs build, because we generate both esm and cjs.\n */\n\nconst pairSplitRegExp = /; */;\n\n/**\n * RegExp to match field-content in RFC 7230 sec 3.2\n *\n * field-content = field-vchar [ 1*( SP / HTAB ) field-vchar ]\n * field-vchar = VCHAR / obs-text\n * obs-text = %x80-FF\n */\n\n// eslint-disable-next-line no-control-regex\nconst fieldContentRegExp = /^[\\u0009\\u0020-\\u007e\\u0080-\\u00ff]+$/;\n\nfunction tryDecode(str: string, decode: (str: string) => string) {\n try {\n return decode(str);\n } catch (e) {\n return str;\n }\n}\n\n/**\n * Parse a cookie header.\n *\n * Parse the given cookie header string into an object\n * The object has the various cookies as keys(names) => values\n *\n */\nexport function parse(\n str: string,\n options: {\n decode: (str: string) => string;\n } = {\n decode: decodeURIComponent,\n },\n): Record {\n const obj: Record = {};\n const pairs = str.split(pairSplitRegExp);\n\n for (const pair of pairs) {\n let eqIdx = pair.indexOf('=');\n\n // skip things that don't look like key=value\n if (eqIdx < 0) continue;\n\n const key = pair.substr(0, eqIdx).trim();\n let val = pair.substr(++eqIdx, pair.length).trim();\n\n // quoted values\n if ('\"' == val[0]) val = val.slice(1, -1);\n\n // only assign once\n if (obj[key] == null) obj[key] = tryDecode(val, options.decode);\n }\n\n return obj;\n}\n\nexport type SerializeOptions = Partial<{\n encode: (str: string) => string;\n maxAge: number;\n domain: string;\n path: string;\n httpOnly: boolean;\n secure: boolean;\n sameSite: boolean | 'Strict' | 'strict' | 'Lax' | 'lax' | 'None' | 'none' | string;\n expires: Date;\n}>;\n\nexport function serialize(name: string, val: string, opt: SerializeOptions = {}): string {\n if (!opt.encode) opt.encode = encodeURIComponent;\n\n if (!fieldContentRegExp.test(name)) throw new TypeError('argument name is invalid');\n\n const value = opt.encode(val);\n\n if (value && !fieldContentRegExp.test(value)) throw new TypeError('argument val is invalid');\n\n let str = name + '=' + value;\n\n if (null != opt.maxAge) {\n const maxAge = opt.maxAge - 0;\n\n if (isNaN(maxAge) || !isFinite(maxAge)) throw new TypeError('option maxAge is invalid');\n\n str += '; Max-Age=' + Math.floor(maxAge);\n }\n\n if (opt.domain) {\n if (!fieldContentRegExp.test(opt.domain)) throw new TypeError('option domain is invalid');\n\n str += '; Domain=' + opt.domain;\n }\n\n if (opt.path) {\n if (!fieldContentRegExp.test(opt.path)) throw new TypeError('option path is invalid');\n\n str += '; Path=' + opt.path;\n }\n\n if (opt.expires) str += '; Expires=' + opt.expires.toUTCString();\n\n if (opt.httpOnly) str += '; HttpOnly';\n\n if (opt.secure) str += '; Secure';\n\n if (opt.sameSite) {\n const sameSite = typeof opt.sameSite === 'string' ? opt.sameSite.toLowerCase() : opt.sameSite;\n\n switch (sameSite) {\n case true:\n case 'strict':\n str += '; SameSite=Strict';\n break;\n case 'lax':\n str += '; SameSite=Lax';\n break;\n case 'none':\n str += '; SameSite=None';\n break;\n default:\n throw new TypeError('option sameSite is invalid');\n }\n }\n\n return str;\n}\n","const chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';\nexport function btoa(input = '') {\n let str = input;\n let output = '';\n\n for (\n let block = 0, charCode, i = 0, map = chars;\n str.charAt(i | 0) || ((map = '='), i % 1);\n output += map.charAt(63 & (block >> (8 - (i % 1) * 8)))\n ) {\n charCode = str.charCodeAt((i += 3 / 4));\n\n if (charCode > 0xff) {\n throw new Error(\"'btoa' failed: The string to be encoded contains characters outside of the Latin1 range.\");\n }\n\n block = (block << 8) | charCode;\n }\n\n return output;\n}\n","export interface SchoolYear {\n name: string;\n id: number;\n startDate: Date;\n endDate: Date;\n}\n\nexport interface MessagesOfDay {\n id: number;\n subject: string;\n text: string;\n isExpanded: boolean;\n /**\n * Unknown type. I have never seen this in use.\n */\n attachments: any[];\n}\n\nexport interface NewsWidget {\n /**\n * Unknown type. I have never seen this in use.\n */\n systemMessage: any;\n messagesOfDay: MessagesOfDay[];\n rssUrl: string;\n}\n\nexport interface Messagesender {\n userId: number;\n displayName: string;\n imageUrl: string;\n className: string;\n}\n\nexport interface Inboxmessage {\n allowMessageDeletion: boolean;\n contentPreview: string;\n hasAttachments: boolean;\n id: number;\n isMessageRead: boolean;\n isReply: boolean;\n isReplyAllowed: boolean;\n sender: Messagesender;\n sentDateTime: string;\n subject: string;\n}\n\nexport interface Inbox {\n incomingMessages: Inboxmessage[];\n}\n\nexport interface ShortData {\n id: number;\n name: string;\n longname: string;\n orgname?: string;\n orgid?: number;\n}\n\nexport interface Lesson {\n id: number;\n date: number;\n startTime: number;\n endTime: number;\n kl: ShortData[];\n te: ShortData[];\n su: ShortData[];\n ro: ShortData[];\n lstext?: string;\n lsnumber: number;\n activityType?: 'Unterricht' | string;\n code?: 'cancelled' | 'irregular';\n info?: string;\n substText?: string;\n statflags?: string;\n sg?: string;\n bkRemark?: string;\n bkText?: string;\n}\n\nexport interface Homework {\n /**\n * Unknown type. I have never seen this in use.\n */\n attachments: Array;\n completed: boolean;\n date: number;\n dueDate: number;\n id: number;\n lessonId: number;\n remark: string;\n text: string;\n}\n\nexport interface Subject {\n id: number;\n name: string;\n longName: string;\n alternateName: string | '';\n active: boolean;\n foreColor: string;\n backColor: string;\n}\n\nexport enum WebUntisDay {\n Sunday = 1,\n Monday = 2,\n Tuesday = 3,\n Wednesday = 4,\n Thursday = 5,\n Friday = 6,\n Saturday = 7,\n}\n\nexport interface TimeUnit {\n name: string;\n startTime: number;\n endTime: number;\n}\n\nexport interface Timegrid {\n day: WebUntisDay;\n timeUnits: TimeUnit[];\n}\n\nexport interface Exam {\n id: number;\n examType: string;\n name: string;\n studentClass: string[];\n assignedStudents: {\n klasse: { id: number; name: string };\n displayName: string;\n id: number;\n }[];\n examDate: number;\n startTime: number;\n endTime: number;\n subject: string;\n teachers: string[];\n rooms: string[];\n text: string;\n grade?: string;\n}\n\nexport enum WebUntisElementType {\n CLASS = 1,\n TEACHER = 2,\n SUBJECT = 3,\n ROOM = 4,\n STUDENT = 5,\n}\n\nexport interface WebElement {\n type: WebUntisElementType;\n id: number;\n orgId: number;\n missing: boolean;\n state: 'REGULAR' | 'ABSENT' | 'SUBSTITUTED';\n}\n\nexport interface WebElementData extends WebElement {\n element: {\n type: number;\n id: number;\n name: string;\n longName?: string;\n displayname?: string;\n alternatename?: string;\n canViewTimetable: boolean;\n externalKey?: string;\n roomCapacity: number;\n };\n}\n\nexport interface WebAPITimetable {\n id: number;\n lessonId: number;\n lessonNumber: number;\n lessonCode: string;\n lessonText: string;\n periodText: string;\n hasPeriodText: false;\n periodInfo: string;\n periodAttachments: [];\n substText: string;\n date: number;\n startTime: number;\n endTime: number;\n elements: WebElement[];\n studentGroup: string;\n hasInfo: boolean;\n code: number;\n cellState: 'STANDARD' | 'SUBSTITUTION' | 'ROOMSUBSTITUTION';\n priority: number;\n is: {\n roomSubstitution?: boolean;\n substitution?: boolean;\n standard?: boolean;\n event: boolean;\n };\n roomCapacity: number;\n studentCount: number;\n classes: WebElementData[];\n teachers: WebElementData[];\n subjects: WebElementData[];\n rooms: WebElementData[];\n students: WebElementData[];\n}\n\nexport interface Teacher {\n id: number;\n name: string;\n foreName: string;\n longName: string;\n foreColor: string;\n backColor: string;\n}\n\nexport interface Student {\n id: number;\n key: number;\n name: string;\n foreName: string;\n longName: string;\n gender: string;\n}\n\nexport interface Room {\n id: number;\n name: string;\n longName: string;\n alternateName: string | '';\n active: boolean;\n foreColor: string;\n backColor: string;\n}\n\nexport interface Klasse {\n id: number;\n name: string;\n longName: string;\n active: boolean;\n foreColor?: string;\n backColor?: string;\n did?: number;\n teacher1?: number;\n teacher2?: number;\n}\n\nexport interface Department {\n id: number;\n name: string;\n longName: string;\n}\n\nexport interface Holiday {\n name: string;\n longName: string;\n id: number;\n startDate: number;\n endDate: number;\n}\n\nexport interface ColorEntity {\n foreColor: string;\n backColor: string;\n}\n\nexport interface LsEntity {\n ls?: ColorEntity | null;\n oh?: ColorEntity | null;\n sb?: ColorEntity | null;\n bs?: ColorEntity | null;\n ex?: ColorEntity | null;\n}\n\nexport interface CodesEntity {\n cancelled?: ColorEntity | null;\n irregular?: ColorEntity | null;\n}\n\nexport interface StatusData {\n lstypes: LsEntity[];\n codes: CodesEntity[];\n}\n\nexport interface Absences {\n absences: Absence[];\n absenceReasons: [];\n excuseStatuses: boolean;\n showAbsenceReasonChange: boolean;\n showCreateAbsence: boolean;\n}\n\nexport interface Absence {\n id: number;\n startDate: number;\n endDate: number;\n startTime: number;\n endTime: number;\n createDate: number;\n lastUpdate: number;\n createdUser: string;\n updatedUser: string;\n reasonId: number;\n reason: string;\n text: string;\n interruptions: [];\n canEdit: boolean;\n studentName: string;\n excuseStatus: string;\n isExcused: boolean;\n excuse: Excuse;\n}\n\nexport interface Excuse {\n id: number;\n text: string;\n excuseDate: number;\n excuseStatus: string;\n isExcused: boolean;\n userId: number;\n username: string;\n}\n","import { serialize } from './cookie';\nimport axios from 'axios';\nimport { btoa } from './base-64';\nimport { parse as fnsParse, startOfDay, format, type ParseOptions } from 'date-fns';\nimport type { AxiosInstance } from 'axios';\nimport type {\n Absences,\n Department,\n Exam,\n Holiday,\n Homework,\n Inbox,\n Klasse,\n Lesson,\n NewsWidget,\n Room,\n SchoolYear,\n StatusData,\n Student,\n Subject,\n Teacher,\n Timegrid,\n WebAPITimetable,\n} from './types';\nimport type { InternalSchoolYear, SessionInformation } from './internal';\nimport { WebUntisElementType } from './types';\n\n/**\n * Ensures that the dateStr is a string when calling {@link fnsParse}.\n * This is needed since some WebUntis servers return numbers instead of strings.\n * @param dateStr {string | number}\n * @param formatStr {string}\n * @param referenceDate {DateType | number | string}\n * @param options {ParseOptions | undefined}\n * @returns \n */\nconst parse = (\n dateStr: string | number,\n formatStr: string,\n referenceDate: DateType | number | string,\n options?: ParseOptions,\n) => {\n return fnsParse(`${dateStr}`, formatStr, referenceDate, options);\n};\n\nexport class Base {\n school: string;\n schoolbase64: string;\n username: string;\n password: string;\n baseurl: string;\n cookies: string[];\n id: string;\n sessionInformation: SessionInformation | null;\n anonymous: boolean;\n\n axios: AxiosInstance;\n\n static TYPES = WebUntisElementType;\n\n /**\n *\n * @constructor\n * @param {string} school The school identifier\n * @param {string} username\n * @param {string} password\n * @param {string} baseurl Just the host name of your WebUntis (Example: mese.webuntis.com)\n * @param {string} [identity=\"Awesome\"] A identity like: MyAwesomeApp\n * @param {boolean} [disableUserAgent=false] If this is true, axios will not send a custom User-Agent\n */\n constructor(\n school: string,\n username: string,\n password: string,\n baseurl: string,\n identity = 'Awesome',\n disableUserAgent = false,\n ) {\n this.school = school;\n this.schoolbase64 = '_' + btoa(this.school);\n this.username = username;\n this.password = password;\n this.baseurl = 'https://' + baseurl + '/';\n this.cookies = [];\n this.id = identity;\n this.sessionInformation = {};\n this.anonymous = false;\n\n const additionalHeaders: Record = {};\n\n if (!disableUserAgent) {\n additionalHeaders['User-Agent'] =\n 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3163.79 Safari/537.36';\n }\n\n this.axios = axios.create({\n baseURL: this.baseurl,\n maxRedirects: 0,\n headers: {\n 'Cache-Control': 'no-cache',\n Pragma: 'no-cache',\n 'X-Requested-With': 'XMLHttpRequest',\n ...additionalHeaders,\n },\n validateStatus: function (status) {\n return status >= 200 && status < 303; // default\n },\n });\n }\n\n /**\n * Logout the current session\n */\n async logout(): Promise {\n await this.axios({\n method: 'POST',\n url: `/WebUntis/jsonrpc.do`,\n params: {\n school: this.school,\n },\n data: {\n id: this.id,\n method: 'logout',\n params: {},\n jsonrpc: '2.0',\n },\n });\n this.sessionInformation = null;\n return true;\n }\n\n /**\n * Login with your credentials\n *\n * **Notice: The server may revoke this session after less than 10min of idle.**\n *\n * *Untis says in the official docs:*\n * > An application should always log out as soon as possible to free system resources on the server.\n */\n async login(): Promise {\n const response = await this.axios({\n method: 'POST',\n url: `/WebUntis/jsonrpc.do`,\n params: {\n school: this.school,\n },\n data: {\n id: this.id,\n method: 'authenticate',\n params: {\n user: this.username,\n password: this.password,\n client: this.id,\n },\n jsonrpc: '2.0',\n },\n });\n if (typeof response.data !== 'object') throw new Error('Failed to parse server response.');\n if (!response.data.result) throw new Error('Failed to login. ' + JSON.stringify(response.data));\n if (response.data.result.code) throw new Error('Login returned error code: ' + response.data.result.code);\n if (!response.data.result.sessionId) throw new Error('Failed to login. No session id.');\n this.sessionInformation = response.data.result;\n return response.data.result;\n }\n\n /**\n * Get the latest WebUntis Schoolyear\n * @param {Boolean} [validateSession=true]\n */\n async getLatestSchoolyear(validateSession = true): Promise {\n const data = await this._request('getSchoolyears', {}, validateSession);\n data.sort((a, b) => {\n const na = parse(a.startDate, 'yyyyMMdd', new Date());\n const nb = parse(b.startDate, 'yyyyMMdd', new Date());\n return nb.getTime() - na.getTime();\n });\n if (!data[0]) throw new Error('Failed to receive school year');\n return {\n name: data[0].name,\n id: data[0].id,\n startDate: parse(data[0].startDate, 'yyyyMMdd', new Date()),\n endDate: parse(data[0].endDate, 'yyyyMMdd', new Date()),\n };\n }\n\n /**\n * Get all WebUntis Schoolyears\n * @param {Boolean} [validateSession=true]\n */\n async getSchoolyears(validateSession = true): Promise {\n const data = await this._request('getSchoolyears', {}, validateSession);\n data.sort((a, b) => {\n const na = parse(a.startDate, 'yyyyMMdd', new Date());\n const nb = parse(b.startDate, 'yyyyMMdd', new Date());\n return nb.getTime() - na.getTime();\n });\n if (!data[0]) throw new Error('Failed to receive school year');\n return data.map((year) => {\n return {\n name: year.name,\n id: year.id,\n startDate: parse(year.startDate, 'yyyyMMdd', new Date()),\n endDate: parse(year.endDate, 'yyyyMMdd', new Date()),\n };\n });\n }\n\n /**\n * Get News Widget\n * @param {Date} date\n * @param {boolean} [validateSession=true]\n * @returns {Promise} see index.d.ts NewsWidget\n */\n async getNewsWidget(date: Date, validateSession = true): Promise {\n if (validateSession && !(await this.validateSession())) throw new Error('Current Session is not valid');\n const response = await this.axios({\n method: 'GET',\n url: `/WebUntis/api/public/news/newsWidgetData`,\n params: {\n date: Base.convertDateToUntis(date),\n },\n headers: {\n Cookie: this._buildCookies(),\n },\n });\n if (typeof response.data.data !== 'object') throw new Error('Server returned invalid data.');\n return response.data.data;\n }\n\n /**\n * Get Inbox\n */\n async getInbox(validateSession = true): Promise {\n this._checkAnonymous();\n if (validateSession && !(await this.validateSession())) throw new Error('Current Session is not valid');\n //first get JWT Token\n if (typeof this.sessionInformation!.jwt_token != 'string') await this._getJWT();\n const response = await this.axios({\n method: 'GET',\n url: `/WebUntis/api/rest/view/v1/messages`,\n headers: {\n Authorization: `Bearer ${this.sessionInformation!.jwt_token}`,\n Cookie: this._buildCookies(),\n },\n });\n if (typeof response.data !== 'object') throw new Error('Server returned invalid data.');\n return response.data;\n }\n\n private _checkAnonymous() {\n if (this.anonymous) {\n throw new Error('This method is not supported with anonymous login');\n }\n }\n\n /**\n *\n * @returns {string}\n * @private\n */\n _buildCookies() {\n let cookies = [];\n cookies.push(serialize('JSESSIONID', this.sessionInformation!.sessionId!));\n cookies.push(serialize('schoolname', this.schoolbase64));\n return cookies.join('; ');\n }\n\n /**\n * Get JWT Token\n * @private\n */\n async _getJWT(validateSession = true): Promise {\n if (validateSession && !(await this.validateSession())) throw new Error('Current Session is not valid');\n const response = await this.axios({\n method: 'GET',\n url: `/WebUntis/api/token/new`,\n headers: {\n //Authorization: `Bearer ${this._getToken()}`,\n Cookie: this._buildCookies(),\n },\n });\n\n if (typeof response.data !== 'string') throw new Error('Server returned invalid data.');\n this.sessionInformation!.jwt_token = response.data;\n return response.data;\n }\n\n /**\n * Checks if your current WebUntis Session is valid\n */\n async validateSession(): Promise {\n if (!this.sessionInformation) return false;\n const response = await this.axios({\n method: 'POST',\n url: `/WebUntis/jsonrpc.do`,\n params: {\n school: this.school,\n },\n headers: {\n Cookie: this._buildCookies(),\n },\n data: {\n id: this.id,\n method: 'getLatestImportTime',\n params: {},\n jsonrpc: '2.0',\n },\n });\n return typeof response.data.result === 'number';\n }\n\n /**\n * Get the time when WebUntis last changed its data\n * @param {Boolean} [validateSession=true]\n */\n async getLatestImportTime(validateSession = true): Promise {\n return this._request('getLatestImportTime', {}, validateSession);\n }\n\n /**\n *\n * @param id\n * @param type\n * @param startDate\n * @param endDate\n * @param validateSession\n * @private\n */\n private async _timetableRequest(\n id: string | number,\n type: number,\n startDate?: Date | null,\n endDate?: Date | null,\n validateSession = true,\n ): Promise {\n const additionalOptions: Record = {};\n if (startDate) {\n additionalOptions.startDate = Base.convertDateToUntis(startDate);\n }\n if (endDate) {\n additionalOptions.endDate = Base.convertDateToUntis(endDate);\n }\n\n return this._request(\n 'getTimetable',\n {\n options: {\n id: new Date().getTime(),\n element: {\n id,\n type,\n },\n ...additionalOptions,\n showLsText: true,\n showStudentgroup: true,\n showLsNumber: true,\n showSubstText: true,\n showInfo: true,\n showBooking: true,\n klasseFields: ['id', 'name', 'longname', 'externalkey'],\n roomFields: ['id', 'name', 'longname', 'externalkey'],\n subjectFields: ['id', 'name', 'longname', 'externalkey'],\n teacherFields: ['id', 'name', 'longname', 'externalkey'],\n },\n },\n validateSession,\n );\n }\n\n /**\n * Get your own Timetable for the current day\n * Note: You can't use this with anonymous login\n * @param {Boolean} [validateSession=true]\n * @returns {Promise}\n */\n async getOwnTimetableForToday(validateSession = true): Promise {\n this._checkAnonymous();\n return await this._timetableRequest(\n this.sessionInformation!.personId!,\n this.sessionInformation!.personType!,\n null,\n null,\n validateSession,\n );\n }\n\n /**\n * Get the timetable of today for a specific element.\n * @param {number} id\n * @param {WebUntisElementType} type\n * @param {Boolean} [validateSession=true]\n * @returns {Promise}\n */\n async getTimetableForToday(id: number, type: number, validateSession = true): Promise {\n return await this._timetableRequest(id, type, null, null, validateSession);\n }\n\n /**\n * Get your own Timetable for the given day\n * Note: You can't use this with anonymous login\n * @param {Date} date\n * @param {Boolean} [validateSession=true]\n */\n async getOwnTimetableFor(date: Date, validateSession = true): Promise {\n this._checkAnonymous();\n return await this._timetableRequest(\n this.sessionInformation!.personId!,\n this.sessionInformation!.personType!,\n date,\n date,\n validateSession,\n );\n }\n\n /**\n * Get the timetable for a specific day for a specific element.\n * @param {Date} date\n * @param {number} id\n * @param {WebUntisElementType} type\n * @param {Boolean} [validateSession=true]\n */\n async getTimetableFor(date: Date, id: number, type: number, validateSession = true): Promise {\n return await this._timetableRequest(id, type, date, date, validateSession);\n }\n\n /**\n * Get your own timetable for a given Date range\n * Note: You can't use this with anonymous login\n * @param {Date} rangeStart\n * @param {Date} rangeEnd\n * @param {Boolean} [validateSession=true]\n * @returns {Promise.}\n */\n async getOwnTimetableForRange(rangeStart: Date, rangeEnd: Date, validateSession = true): Promise {\n this._checkAnonymous();\n return await this._timetableRequest(\n this.sessionInformation!.personId!,\n this.sessionInformation!.personType!,\n rangeStart,\n rangeEnd,\n validateSession,\n );\n }\n\n /**\n * Get the timetable for a given Date range for specific element\n * @param {Date} rangeStart\n * @param {Date} rangeEnd\n * @param {number} id\n * @param {WebUntisElementType} type\n * @param {Boolean} [validateSession=true]\n */\n async getTimetableForRange(\n rangeStart: Date,\n rangeEnd: Date,\n id: number,\n type: number,\n validateSession = true,\n ): Promise {\n return await this._timetableRequest(id, type, rangeStart, rangeEnd, validateSession);\n }\n\n /**\n * Get the Timetable of your class for today\n * Note: You can't use this with anonymous login\n * @param {Boolean} [validateSession=true]\n * @returns {Promise}\n */\n async getOwnClassTimetableForToday(validateSession = true): Promise {\n this._checkAnonymous();\n return await this._timetableRequest(this.sessionInformation!.klasseId!, 1, null, null, validateSession);\n }\n\n /**\n * Get the Timetable of your class for the given day\n * Note: You can't use this with anonymous login\n * @param {Date} date\n * @param {Boolean} [validateSession=true]\n * @returns {Promise.}\n */\n async getOwnClassTimetableFor(date: Date, validateSession = true): Promise {\n this._checkAnonymous();\n return await this._timetableRequest(this.sessionInformation!.klasseId!, 1, date, date, validateSession);\n }\n\n /**\n * Get the Timetable of your class for a given Date range\n * Note: You can't use this with anonymous login\n * @param {Date} rangeStart\n * @param {Date} rangeEnd\n * @param {boolean} [validateSession=true]\n */\n async getOwnClassTimetableForRange(rangeStart: Date, rangeEnd: Date, validateSession = true): Promise {\n this._checkAnonymous();\n return await this._timetableRequest(\n this.sessionInformation!.klasseId!,\n 1,\n rangeStart,\n rangeEnd,\n validateSession,\n );\n }\n\n /**\n *\n * @param {Date} rangeStart\n * @param {Date} rangeEnd\n * @param {boolean} [validateSession=true]\n * @returns {Promise.}\n */\n async getHomeWorksFor(rangeStart: Date, rangeEnd: Date, validateSession = true): Promise {\n if (validateSession && !(await this.validateSession())) throw new Error('Current Session is not valid');\n const response = await this.axios({\n method: 'GET',\n url: `/WebUntis/api/homeworks/lessons`,\n params: {\n startDate: Base.convertDateToUntis(rangeStart),\n endDate: Base.convertDateToUntis(rangeEnd),\n },\n headers: {\n Cookie: this._buildCookies(),\n },\n });\n if (typeof response.data.data !== 'object') throw new Error('Server returned invalid data.');\n if (!response.data.data['homeworks']) throw new Error(\"Data object doesn't contains homeworks object.\");\n return response.data.data;\n }\n\n /**\n * Converts the untis date string format to a normal JS Date object\n * @param {string} date Untis date string\n * @param {Date} [baseDate=new Date()] Base date. Default beginning of current day\n * @static\n */\n static convertUntisDate(date: string, baseDate = startOfDay(new Date())): Date {\n if (typeof date !== 'string') date = `${date}`;\n return parse(date, 'yyyyMMdd', baseDate);\n }\n\n /**\n * Convert a untis time string to a JS Date object\n * @param {string|number} time Untis time string\n * @param {Date} [baseDate=new Date()] Day used as base for the time. Default: Current date\n * @static\n */\n static convertUntisTime(time: number | string, baseDate = new Date()): Date {\n if (typeof time !== 'string') time = `${time}`;\n return parse(time.padStart(4, '0'), 'Hmm', baseDate);\n }\n\n /**\n * Get all known Subjects for the current logged-in user\n * @param {boolean} [validateSession=true]\n */\n async getSubjects(validateSession = true): Promise {\n return await this._request('getSubjects', {}, validateSession);\n }\n\n /**\n * Get the timegrid of current school\n * @param {boolean} [validateSession=true]\n * @returns {Promise.}\n */\n async getTimegrid(validateSession = true): Promise {\n return await this._request('getTimegridUnits', {}, validateSession);\n }\n\n /**\n *\n * TODO: Find out what type this function returns\n * @param {Date} rangeStart\n * @param {Date} rangeEnd\n * @param {boolean} [validateSession=true]\n * @returns {Promise.}\n */\n async getHomeWorkAndLessons(rangeStart: Date, rangeEnd: Date, validateSession = true): Promise> {\n if (validateSession && !(await this.validateSession())) throw new Error('Current Session is not valid');\n const response = await this.axios({\n method: 'GET',\n url: `/WebUntis/api/homeworks/lessons`,\n params: {\n startDate: Base.convertDateToUntis(rangeStart),\n endDate: Base.convertDateToUntis(rangeEnd),\n },\n headers: {\n Cookie: this._buildCookies(),\n },\n });\n if (typeof response.data.data !== 'object') throw new Error('Server returned invalid data.');\n if (!response.data.data['homeworks']) throw new Error(\"Data object doesn't contains homeworks object.\");\n return response.data.data;\n }\n\n /**\n * Get Exams for range\n * @param {Date} rangeStart\n * @param {Date} rangeEnd\n * @param {Number} klasseId\n * @param {boolean} withGrades\n * @param {boolean} [validateSession=true]\n */\n async getExamsForRange(\n rangeStart: Date,\n rangeEnd: Date,\n klasseId = -1,\n withGrades = false,\n validateSession = true,\n ): Promise> {\n if (validateSession && !(await this.validateSession())) throw new Error('Current Session is not valid');\n const response = await this.axios({\n method: 'GET',\n url: `/WebUntis/api/exams`,\n params: {\n startDate: Base.convertDateToUntis(rangeStart),\n endDate: Base.convertDateToUntis(rangeEnd),\n klasseId: klasseId,\n withGrades: withGrades,\n },\n headers: {\n Cookie: this._buildCookies(),\n },\n });\n if (typeof response.data.data !== 'object') throw new Error('Server returned invalid data.');\n if (!response.data.data['exams']) throw new Error(\"Data object doesn't contains exams object.\");\n return response.data.data['exams'];\n }\n\n /**\n * Get the timetable for the current week for a specific element from the web client API.\n * @param {Date} date one date in the week to query\n * @param {number} id element id\n * @param {WebUntisElementType} type element type\n * @param {Number} [formatId=1] set to 1 to include teachers, 2 omits the teachers in elements response\n * @param {Boolean} [validateSession=true]\n */\n async getTimetableForWeek(\n date: Date,\n id: number,\n type: number,\n formatId = 1,\n validateSession = true,\n ): Promise {\n if (validateSession && !(await this.validateSession())) throw new Error('Current Session is not valid');\n\n const response = await this.axios({\n method: 'GET',\n url: `/WebUntis/api/public/timetable/weekly/data`,\n params: {\n elementType: type,\n elementId: id,\n date: format(date, 'yyyy-MM-dd'),\n formatId: formatId,\n },\n headers: {\n Cookie: this._buildCookies(),\n },\n });\n\n if (typeof response.data.data !== 'object') throw new Error('Server returned invalid data.');\n\n if (response.data.data.error) {\n /* known codes:\n * - ERR_TTVIEW_NOTALLOWED_ONDATE\n */\n const err = new Error('Server responded with error');\n // TODO: Make this better lol\n // @ts-ignore\n err.code = response.data.data.error?.data?.messageKey;\n throw err;\n }\n\n if (!response.data.data.result?.data?.elementPeriods?.[id]) throw new Error('Invalid response');\n\n const data = response.data.data.result.data;\n\n // TODO: improve typings\n\n const formatElements = (elements: Array>, { byType }: { byType: number }) => {\n const filteredElements = elements.filter((element) => element.type === byType);\n\n return filteredElements.map((element) => ({\n ...element,\n element: data.elements.find(\n (dataElement: Record) =>\n dataElement.type === byType && dataElement.id === element.id,\n ),\n }));\n };\n\n const timetable = data.elementPeriods[id].map((lesson: any) => ({\n ...lesson,\n classes: formatElements(lesson.elements, { byType: Base.TYPES.CLASS }),\n teachers: formatElements(lesson.elements, { byType: Base.TYPES.TEACHER }),\n subjects: formatElements(lesson.elements, { byType: Base.TYPES.SUBJECT }),\n rooms: formatElements(lesson.elements, { byType: Base.TYPES.ROOM }),\n students: formatElements(lesson.elements, { byType: Base.TYPES.STUDENT }),\n }));\n\n return timetable;\n }\n\n /**\n * Get the timetable for the current week for the current element from the web client API.\n * @param {Date} date one date in the week to query\n * @param {Number} [formatId=1] set to 1 to include teachers, 2 omits the teachers in elements response\n * @param {Boolean} [validateSession=true]\n * @returns {Promise}\n */\n async getOwnTimetableForWeek(date: Date, formatId = 1, validateSession = true): Promise {\n this._checkAnonymous();\n return await this.getTimetableForWeek(\n date,\n this.sessionInformation!.personId!,\n this.sessionInformation!.personType!,\n formatId,\n validateSession,\n );\n }\n\n /**\n * Get all known teachers by WebUntis\n * @param {boolean} [validateSession=true]\n * @returns {Promise.}\n */\n async getTeachers(validateSession = true): Promise {\n return await this._request('getTeachers', {}, validateSession);\n }\n\n /**\n * Get all known students by WebUntis\n * @param {boolean} [validateSession=true]\n * @returns {Promise.}\n */\n async getStudents(validateSession = true): Promise {\n return await this._request('getStudents', {}, validateSession);\n }\n\n /**\n * Get all known rooms by WebUntis\n * @param {boolean} [validateSession=true]\n * @returns {Promise.}\n */\n async getRooms(validateSession = true): Promise {\n return await this._request('getRooms', {}, validateSession);\n }\n\n /**\n * Get all classes known by WebUntis\n * @param {boolean} [validateSession=true]\n * @param {number} schoolyearId\n * @returns {Promise.}\n */\n async getClasses(validateSession = true, schoolyearId: number): Promise {\n const data = typeof schoolyearId !== 'number' ? {} : { schoolyearId };\n return await this._request('getKlassen', data, validateSession);\n }\n\n /**\n * Get all departments known by WebUntis\n * @param {boolean} [validateSession=true]\n * @returns {Promise.}\n */\n async getDepartments(validateSession = true): Promise {\n return await this._request('getDepartments', {}, validateSession);\n }\n\n /**\n * Get all holidays known by WebUntis\n * @param {boolean} [validateSession=true]\n * @returns {Promise.}\n */\n async getHolidays(validateSession = true): Promise {\n return await this._request('getHolidays', {}, validateSession);\n }\n\n /**\n * Get all status data known by WebUntis\n * @param {boolean} [validateSession=true]\n * @returns {Promise.}\n */\n async getStatusData(validateSession = true): Promise {\n return await this._request('getStatusData', {}, validateSession);\n }\n\n /**\n * Get the current school year\n * @param [validateSession=true]\n * @returns {Promise.}\n */\n async getCurrentSchoolyear(validateSession = true): Promise {\n const data = await this._request('getCurrentSchoolyear', {}, validateSession);\n\n if (!data) throw new Error('Failed to retrieve current school year');\n\n return {\n name: data.name,\n id: data.id,\n startDate: Base.convertUntisDate(data.startDate),\n endDate: Base.convertUntisDate(data.endDate),\n };\n }\n\n /**\n * Convert a JS Date Object to a WebUntis date string\n * @param {Date} date\n * @returns {String}\n */\n static convertDateToUntis(date: Date): string {\n return (\n date.getFullYear().toString() +\n (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1).toString() +\n (date.getDate() < 10 ? '0' + date.getDate() : date.getDate()).toString()\n );\n }\n\n /**\n * Make a JSON RPC Request with the current session\n * @param {string} method\n * @param {Object} [parameter={}]\n * @param {string} [url='/WebUntis/jsonrpc.do?school=SCHOOL']\n * @param {boolean} [validateSession=true] Whether the session should be checked first\n * @returns {Promise.}\n * @private\n */\n async _request>(\n method: string,\n parameter: Record = {},\n validateSession = true,\n url = `/WebUntis/jsonrpc.do`,\n ): Promise {\n if (validateSession && !(await this.validateSession())) throw new Error('Current Session is not valid');\n const response = await this.axios({\n method: 'POST',\n url: url,\n params: {\n school: this.school,\n },\n headers: {\n Cookie: this._buildCookies(),\n },\n data: {\n id: this.id,\n method: method,\n params: parameter,\n jsonrpc: '2.0',\n },\n });\n if (!response.data.result) throw new Error(\"Server didn't return any result.\");\n if (response.data.result.code) throw new Error('Server returned error code: ' + response.data.result.code);\n return response.data.result;\n }\n\n /**\n * Returns all the Lessons where you were absent including the excused one!\n * @param {Date} rangeStart\n * @param {Date} rangeEnd\n * @param {Integer} [excuseStatusId=-1]\n * @param {boolean} [validateSession=true]\n * @returns {Promise}\n */\n async getAbsentLesson(\n rangeStart: Date,\n rangeEnd: Date,\n excuseStatusId = -1,\n validateSession = true,\n ): Promise {\n if (validateSession && !(await this.validateSession())) throw new Error('Current Session is not valid');\n this._checkAnonymous();\n const response = await this.axios({\n method: 'GET',\n url: `/WebUntis/api/classreg/absences/students`,\n params: {\n startDate: Base.convertDateToUntis(rangeStart),\n endDate: Base.convertDateToUntis(rangeEnd),\n studentId: this.sessionInformation!.personId!,\n excuseStatusId: excuseStatusId,\n },\n headers: {\n Cookie: this._buildCookies(),\n },\n });\n if (response.data.data == null) throw new Error('Server returned no data!');\n return response.data.data;\n }\n\n /**\n * Returns a URL to a unique PDF of all the lessons you were absent\n * @param {Date} rangeStart\n * @param {Date} rangeEnd\n * @param {boolean} [validateSession=true]\n * @param {Integer} [excuseStatusId=-1]\n * @param {boolean} [lateness=true]\n * @param {boolean} [absences=true]\n * @param {boolean} [excuseGroup=2]\n */\n async getPdfOfAbsentLesson(\n rangeStart: Date,\n rangeEnd: Date,\n validateSession = true,\n excuseStatusId = -1,\n lateness = true,\n absences = true,\n excuseGroup = 2,\n ): Promise {\n if (validateSession && !(await this.validateSession())) throw new Error('Current Session is not valid');\n this._checkAnonymous();\n const response = await this.axios({\n method: 'GET',\n url: `/WebUntis/reports.do`,\n params: {\n name: 'Excuse',\n format: 'pdf',\n rpt_sd: Base.convertDateToUntis(rangeStart),\n rpt_ed: Base.convertDateToUntis(rangeEnd),\n excuseStatusId: excuseStatusId,\n studentId: this.sessionInformation!.personId!,\n withLateness: lateness,\n withAbsences: absences,\n execuseGroup: excuseGroup,\n },\n headers: {\n Cookie: this._buildCookies(),\n },\n });\n const res = response.data.data;\n if (response.status != 200 || res.error) throw new Error('Server returned no data!');\n const pdfDownloadURL =\n this.baseurl + 'WebUntis/reports.do?' + 'msgId=' + res.messageId + '&' + res.reportParams;\n return pdfDownloadURL;\n }\n}\n\n/**\n * @private\n */\nexport class InternalWebuntisSecretLogin extends Base {\n constructor(\n school: string,\n username: string,\n password: string,\n baseurl: string,\n identity = 'Awesome',\n disableUserAgent = false,\n ) {\n super(school, username, password, baseurl, identity, disableUserAgent);\n }\n\n async _otpLogin(token: number | string, username: string, time: number, skipSessionInfo = false) {\n const response = await this.axios({\n method: 'POST',\n url: '/WebUntis/jsonrpc_intern.do',\n params: {\n m: 'getUserData2017',\n school: this.school,\n v: 'i2.2',\n },\n data: {\n id: this.id,\n method: 'getUserData2017',\n params: [\n {\n auth: {\n clientTime: time,\n user: username,\n otp: token,\n },\n },\n ],\n jsonrpc: '2.0',\n },\n });\n if (response.data && response.data.error)\n throw new Error('Failed to login. ' + (response.data.error.message || ''));\n if (!response.headers['set-cookie']) throw new Error(`Failed to login. Server didn't return a set-cookie`);\n if (!this._getCookieFromSetCookie(response.headers['set-cookie']))\n throw new Error(\"Failed to login. Server didn't return a session id.\");\n const sessionId = this._getCookieFromSetCookie(response.headers['set-cookie']);\n // Set session temporary\n this.sessionInformation = {\n sessionId: sessionId,\n };\n if (skipSessionInfo) return this.sessionInformation;\n\n // Get personId & personType\n const appConfigUrl = `/WebUntis/api/app/config`;\n const configResponse = await this.axios({\n method: 'GET',\n url: appConfigUrl,\n headers: {\n Cookie: this._buildCookies(),\n },\n });\n if (typeof configResponse.data !== 'object' || typeof configResponse.data.data !== 'object')\n throw new Error('Failed to fetch app config while login. data (type): ' + typeof response.data);\n // Path -> data.loginServiceConfig.user.persons -> find person with id\n if (\n configResponse.data.data &&\n configResponse.data.data.loginServiceConfig &&\n configResponse.data.data.loginServiceConfig.user &&\n !Number.isInteger(configResponse.data.data.loginServiceConfig.user.personId)\n )\n throw new Error('Invalid personId. personId: ' + configResponse.data.data.loginServiceConfig.user.personId);\n const webUntisLoginServiceUser = configResponse.data.data.loginServiceConfig.user;\n if (!Array.isArray(webUntisLoginServiceUser.persons))\n throw new Error('Invalid person array. persons (type): ' + typeof webUntisLoginServiceUser.persons);\n const person = webUntisLoginServiceUser.persons.find(\n (value: Record) => value.id === configResponse.data.data.loginServiceConfig.user.personId,\n );\n if (!person) throw new Error('Can not find person in person array.');\n if (!Number.isInteger(person.type)) throw new Error('Invalid person type. type (type): ' + person.type);\n this.sessionInformation = {\n sessionId: sessionId,\n personType: person.type,\n personId: configResponse.data.data.loginServiceConfig.user.personId,\n };\n // Get klasseId\n try {\n const dayConfigUrl = `/WebUntis/api/daytimetable/config`;\n const dayConfigResponse = await this.axios({\n method: 'GET',\n url: dayConfigUrl,\n headers: {\n Cookie: this._buildCookies(),\n },\n });\n if (typeof dayConfigResponse.data !== 'object' || typeof dayConfigResponse.data.data !== 'object')\n throw new Error();\n if (!Number.isInteger(dayConfigResponse.data.data.klasseId)) throw new Error();\n this.sessionInformation = {\n sessionId: sessionId,\n personType: person.type,\n personId: configResponse.data.data.loginServiceConfig.user.personId,\n klasseId: dayConfigResponse.data.data.klasseId,\n };\n } catch (e) {\n // klasseId is not important. This request can fail\n }\n return this.sessionInformation;\n }\n\n /**\n *\n * @param {Array} setCookieArray\n * @param {string} [cookieName=\"JSESSIONID\"]\n * @return {string|boolean}\n * @private\n */\n _getCookieFromSetCookie(setCookieArray?: string[], cookieName = 'JSESSIONID') {\n if (!setCookieArray) return;\n for (let i = 0; i < setCookieArray.length; i++) {\n const setCookie = setCookieArray[i];\n if (!setCookie) continue;\n let cookieParts = setCookie.split(';');\n if (!cookieParts || !Array.isArray(cookieParts)) continue;\n for (let cookie of cookieParts) {\n cookie = cookie.trim();\n cookie = cookie.replace(/;/gm, '');\n const [Key, Value] = cookie.split('=');\n if (!Key || !Value) continue;\n if (Key === cookieName) return Value;\n }\n }\n }\n}\n","import { InternalWebuntisSecretLogin } from './base';\nimport type { authenticator } from 'otplib';\n\nexport type Authenticator = typeof authenticator;\n\nexport class WebUntisSecretAuth extends InternalWebuntisSecretLogin {\n private readonly secret: string;\n private authenticator: Authenticator;\n\n /**\n *\n * @constructor\n * @augments WebUntis\n * @param {string} school The school identifier\n * @param {string} user\n * @param {string} secret\n * @param {string} baseurl Just the host name of your WebUntis (Example: mese.webuntis.com)\n * @param {string} [identity=\"Awesome\"] A identity like: MyAwesomeApp\n * @param {Object} authenticator Custom otplib v12 instance. Default will use the default otplib configuration.\n * @param {boolean} [disableUserAgent=false] If this is true, axios will not send a custom User-Agent\n */\n constructor(\n school: string,\n user: string,\n secret: string,\n baseurl: string,\n identity = 'Awesome',\n authenticator: Authenticator,\n disableUserAgent = false,\n ) {\n super(school, user, null as unknown as string, baseurl, identity, disableUserAgent);\n this.secret = secret;\n this.authenticator = authenticator;\n if (!authenticator) {\n if ('import' in globalThis) {\n throw new Error(\n 'You need to provide the otplib object by yourself. We can not eval the require in ESM mode.',\n );\n }\n // React-Native will not eval this expression\n const { authenticator } = eval(\"require('otplib')\");\n this.authenticator = authenticator;\n }\n }\n\n // @ts-ignore\n async login() {\n // Get JSESSION\n const token = this.authenticator.generate(this.secret);\n const time = new Date().getTime();\n return await this._otpLogin(token, this.username, time);\n }\n}\n","import { WebUntisSecretAuth } from './secret';\nimport type { Authenticator } from './secret';\nimport type { URL } from 'url';\n\n/**\n * @private\n */\nexport type URLClass = typeof URL;\n\nexport class WebUntisQR extends WebUntisSecretAuth {\n /**\n * Use the data you get from a WebUntis QR code\n * @constructor\n * @param {string} QRCodeURI A WebUntis uri. This is the data you get from the QR Code from the webuntis webapp under profile->Data access->Display\n * @param {string} [identity=\"Awesome\"] A identity like: MyAwesomeApp\n * @param {Object} authenticator Custom otplib v12 instance. Default will use the default otplib configuration.\n * @param {Object} URL Custom whatwg url implementation. Default will use the nodejs implementation.\n * @param {boolean} [disableUserAgent=false] If this is true, axios will not send a custom User-Agent\n */\n constructor(\n QRCodeURI: string,\n identity: string,\n authenticator: Authenticator,\n URL?: URLClass,\n disableUserAgent = false,\n ) {\n let URLImplementation = URL;\n if (!URL) {\n if ('import' in globalThis) {\n throw new Error(\n 'You need to provide the URL object by yourself. We can not eval the require in ESM mode.',\n );\n }\n // React-Native will not eval this expression\n URLImplementation = eval(\"require('url').URL\") as URLClass;\n }\n const uri = new URLImplementation!(QRCodeURI);\n super(\n uri.searchParams.get('school')!,\n uri.searchParams.get('user')!,\n uri.searchParams.get('key')!,\n uri.searchParams.get('url')!,\n identity,\n authenticator,\n disableUserAgent,\n );\n }\n}\n","import { InternalWebuntisSecretLogin } from './base';\n\nexport class WebUntisAnonymousAuth extends InternalWebuntisSecretLogin {\n /**\n *\n * @param {string} school\n * @param {string} baseurl\n * @param {string} [identity='Awesome']\n * @param {boolean} [disableUserAgent=false] If this is true, axios will not send a custom User-Agent\n */\n constructor(school: string, baseurl: string, identity = 'Awesome', disableUserAgent = false) {\n // TODO: Make this a bit more beautiful and more type safe\n super(school, null as unknown as string, null as unknown as string, baseurl, identity, disableUserAgent);\n this.username = '#anonymous#';\n this.anonymous = true;\n }\n\n override async login() {\n // Check whether the school has public access or not\n const url = `/WebUntis/jsonrpc_intern.do`;\n\n const response = await this.axios({\n method: 'POST',\n url,\n params: {\n m: 'getAppSharedSecret',\n school: this.school,\n v: 'i3.5',\n },\n data: {\n id: this.id,\n method: 'getAppSharedSecret',\n params: [\n {\n userName: '#anonymous#',\n password: '',\n },\n ],\n jsonrpc: '2.0',\n },\n });\n\n if (response.data && response.data.error)\n throw new Error('Failed to login. ' + (response.data.error.message || ''));\n\n // OTP never changes when using anonymous login\n const otp = 100170;\n const time = new Date().getTime();\n return await this._otpLogin(otp, this.username, time, true);\n }\n}\n"],"names":["WebUntisDay","WebUntisElementType","fnsParse","__publicField"],"mappings":";;;AAkBA,MAAM,kBAAqB,GAAA,uCAAA,CAAA;AA0DpB,SAAS,SAAU,CAAA,IAAA,EAAc,GAAa,EAAA,GAAA,GAAwB,EAAY,EAAA;AACrF,EAAA,IAAI,CAAC,GAAI,CAAA,MAAA;AAAQ,IAAA,GAAA,CAAI,MAAS,GAAA,kBAAA,CAAA;AAE9B,EAAI,IAAA,CAAC,kBAAmB,CAAA,IAAA,CAAK,IAAI,CAAA;AAAG,IAAM,MAAA,IAAI,UAAU,0BAA0B,CAAA,CAAA;AAElF,EAAM,MAAA,KAAA,GAAQ,GAAI,CAAA,MAAA,CAAO,GAAG,CAAA,CAAA;AAE5B,EAAA,IAAI,KAAS,IAAA,CAAC,kBAAmB,CAAA,IAAA,CAAK,KAAK,CAAA;AAAG,IAAM,MAAA,IAAI,UAAU,yBAAyB,CAAA,CAAA;AAE3F,EAAI,IAAA,GAAA,GAAM,OAAO,GAAM,GAAA,KAAA,CAAA;AAEvB,EAAI,IAAA,IAAA,IAAQ,IAAI,MAAQ,EAAA;AACpB,IAAM,MAAA,MAAA,GAAS,IAAI,MAAS,GAAA,CAAA,CAAA;AAE5B,IAAA,IAAI,KAAM,CAAA,MAAM,CAAK,IAAA,CAAC,SAAS,MAAM,CAAA;AAAG,MAAM,MAAA,IAAI,UAAU,0BAA0B,CAAA,CAAA;AAEtF,IAAO,GAAA,IAAA,YAAA,GAAe,IAAK,CAAA,KAAA,CAAM,MAAM,CAAA,CAAA;AAAA,GAC3C;AAEA,EAAA,IAAI,IAAI,MAAQ,EAAA;AACZ,IAAA,IAAI,CAAC,kBAAA,CAAmB,IAAK,CAAA,GAAA,CAAI,MAAM,CAAA;AAAG,MAAM,MAAA,IAAI,UAAU,0BAA0B,CAAA,CAAA;AAExF,IAAA,GAAA,IAAO,cA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A,YACV,QAAU,EAAA,EAAA;AAAA,WACd;AAAA,SACJ;AAAA,QACA,OAAS,EAAA,KAAA;AAAA,OACb;AAAA,KACH,CAAA,CAAA;AAED,IAAI,IAAA,QAAA,CAAS,IAAQ,IAAA,QAAA,CAAS,IAAK,CAAA,KAAA;AAC/B,MAAA,MAAM,IAAI,KAAM,CAAA,mBAAA,IAAuB,SAAS,IAAK,CAAA,KAAA,CAAM,WAAW,EAAG,CAAA,CAAA,CAAA;AAG7E,IAAA,MAAM,GAAM,GAAA,MAAA,CAAA;AACZ,IAAA,MAAM,IAAO,GAAA,iBAAA,IAAI,IAAK,EAAA,EAAE,OAAQ,EAAA,CAAA;AAChC,IAAA,OAAO,MAAM,IAAK,CAAA,SAAA,CAAU,KAAK,IAAK,CAAA,QAAA,EAAU,MAAM,IAAI,CAAA,CAAA;AAAA,GAC9D;AACJ;;;;"} \ No newline at end of file diff --git a/docs/classes/InternalWebuntisSecretLogin.html b/docs/classes/InternalWebuntisSecretLogin.html index 4c98eb0..538a47d 100644 --- a/docs/classes/InternalWebuntisSecretLogin.html +++ b/docs/classes/InternalWebuntisSecretLogin.html @@ -1,4 +1,4 @@ -InternalWebuntisSecretLogin | webuntis

Class InternalWebuntisSecretLoginPrivate

Hierarchy (view full)

Constructors

constructor +InternalWebuntisSecretLogin | webuntis

Class InternalWebuntisSecretLoginPrivate

Hierarchy (view full)

Constructors

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

    +

Constructors

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 News Widget

    +
  • 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 +

    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 the Timetable of your class for today Note: You can't use this with anonymous login

    -

    Parameters

    • 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 +

    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 your own Timetable for the current day +

    Parameters

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

    Returns Promise<Lesson[]>

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

    -

    Parameters

    • Optional validateSession: boolean = true

    Returns Promise<Lesson[]>

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

    +

    Parameters

    • 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 all known rooms by WebUntis

    -

    Parameters

    • Optional validateSession: boolean = true

    Returns Promise<Room[]>

  • Get all known Subjects for the current logged-in user

    -

    Parameters

    • Optional validateSession: boolean = true

    Returns Promise<Subject[]>

  • 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 of today for a specific element.

    -

    Parameters

    • 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.

    +
  • 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 all known rooms by WebUntis

    +

    Parameters

    • Optional validateSession: boolean = true

    Returns Promise<Room[]>

  • Get all known Subjects for the current logged-in user

    +

    Parameters

    • Optional validateSession: boolean = true

    Returns Promise<Subject[]>

  • 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 of today for a specific element.

    +

    Parameters

    • 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

    +
  • 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>

  • Logout the current session

    -

    Returns Promise<boolean>

  • Checks if your current WebUntis Session is valid

    -

    Returns Promise<boolean>

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

    +

    Returns Promise<SessionInformation>

  • Logout the current session

    +

    Returns Promise<boolean>

  • Checks if your current WebUntis Session is valid

    +

    Returns Promise<boolean>

  • 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

    +

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

\ No newline at end of file +

Returns Date

Static

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/classes/WebUntis.html b/docs/classes/WebUntis.html index 648ab97..9954d91 100644 --- a/docs/classes/WebUntis.html +++ b/docs/classes/WebUntis.html @@ -1,4 +1,4 @@ -WebUntis | webuntis

Class WebUntis

Hierarchy (view full)

Constructors

constructor +WebUntis | webuntis

Class WebUntis

Hierarchy (view full)

Constructors

Properties

anonymous axios baseurl @@ -56,65 +56,65 @@
  • username: string
  • password: string
  • baseurl: string

    Just the host name of your WebUntis (Example: mese.webuntis.com)

  • Optional identity: string = 'Awesome'

    A identity like: MyAwesomeApp

  • Optional disableUserAgent: boolean = false

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

    -
  • Returns WebUntis

    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

      Returns string

    • Returns void

    • Private

      Get JWT Token

      -

      Parameters

      • validateSession: boolean = true

      Returns Promise<string>

    • Private

      Make a JSON RPC Request with the current session

      +

    Returns WebUntis

    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

      Returns string

    • Returns void

    • Private

      Get JWT Token

      +

      Parameters

      • validateSession: boolean = true

      Returns Promise<string>

    • 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>

    • Private

      Parameters

      • id: string | number
      • type: number
      • Optional startDate: null | Date
      • Optional endDate: null | Date
      • validateSession: boolean = true

      Returns Promise<Lesson[]>

    • 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 the current school year

      -

      Parameters

      • Optional validateSession: boolean = true

      Returns Promise<SchoolYear>

    • Get all departments known by WebUntis

      -

      Parameters

      • Optional validateSession: boolean = true

      Returns Promise<Department[]>

    • Get Exams for range

      -

      Parameters

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

      Returns Promise<Exam[]>

    • Get all holidays known by WebUntis

      -

      Parameters

      • Optional validateSession: boolean = true

      Returns Promise<Holiday[]>

    • TODO: Find out what type this function returns

      -

      Parameters

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

      Returns Promise<any[]>

    • Parameters

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

      Returns Promise<Homework[]>

    • Get Inbox

      -

      Parameters

      • validateSession: boolean = true

      Returns Promise<Inbox>

    • Get the time when WebUntis last changed its data

      -

      Parameters

      • Optional validateSession: boolean = true

      Returns Promise<number>

    • Get the latest WebUntis Schoolyear

      -

      Parameters

      • Optional validateSession: boolean = true

      Returns Promise<SchoolYear>

    • Get News Widget

      +
    • Optional url: string = ...

    Returns Promise<Response>

    • Private

      Parameters

      • id: string | number
      • type: number
      • Optional startDate: null | Date
      • Optional endDate: null | Date
      • validateSession: boolean = true

      Returns Promise<Lesson[]>

    • 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 the current school year

      +

      Parameters

      • Optional validateSession: boolean = true

      Returns Promise<SchoolYear>

    • Get all departments known by WebUntis

      +

      Parameters

      • Optional validateSession: boolean = true

      Returns Promise<Department[]>

    • Get Exams for range

      +

      Parameters

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

      Returns Promise<Exam[]>

    • Get all holidays known by WebUntis

      +

      Parameters

      • Optional validateSession: boolean = true

      Returns Promise<Holiday[]>

    • TODO: Find out what type this function returns

      +

      Parameters

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

      Returns Promise<any[]>

    • Parameters

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

      Returns Promise<Homework[]>

    • Get Inbox

      +

      Parameters

      • validateSession: boolean = true

      Returns Promise<Inbox>

    • Get the time when WebUntis last changed its data

      +

      Parameters

      • Optional validateSession: boolean = true

      Returns Promise<number>

    • Get the latest WebUntis Schoolyear

      +

      Parameters

      • Optional validateSession: boolean = true

      Returns Promise<SchoolYear>

    • Get News Widget

      Parameters

      • date: Date
      • Optional validateSession: boolean = true

      Returns Promise<NewsWidget>

      see index.d.ts NewsWidget

      -
    • Get the Timetable of your class for the given day +

    • 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 +

      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 the Timetable of your class for today +

      Parameters

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

      Returns Promise<Lesson[]>

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

      -

      Parameters

      • Optional validateSession: boolean = true

      Returns Promise<Lesson[]>

    • Get your own Timetable for the given day +

      Parameters

      • 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 +

      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 your own Timetable for the current day +

      Parameters

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

      Returns Promise<Lesson[]>

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

      -

      Parameters

      • Optional validateSession: boolean = true

      Returns Promise<Lesson[]>

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

      +

      Parameters

      • 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 all known rooms by WebUntis

      -

      Parameters

      • Optional validateSession: boolean = true

      Returns Promise<Room[]>

    • Get all WebUntis Schoolyears

      -

      Parameters

      • Optional validateSession: boolean = true

      Returns Promise<SchoolYear[]>

    • Get all status data known by WebUntis

      -

      Parameters

      • Optional validateSession: boolean = true

      Returns Promise<StatusData>

    • Get all known students by WebUntis

      -

      Parameters

      • Optional validateSession: boolean = true

      Returns Promise<Student[]>

    • Get all known Subjects for the current logged-in user

      -

      Parameters

      • Optional validateSession: boolean = true

      Returns Promise<Subject[]>

    • Get all known teachers by WebUntis

      -

      Parameters

      • Optional validateSession: boolean = true

      Returns Promise<Teacher[]>

    • Get the timegrid of current school

      -

      Parameters

      • Optional validateSession: boolean = true

      Returns Promise<Timegrid[]>

    • 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 of today for a specific element.

      -

      Parameters

      • 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.

      +
    • 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 all known rooms by WebUntis

      +

      Parameters

      • Optional validateSession: boolean = true

      Returns Promise<Room[]>

    • Get all WebUntis Schoolyears

      +

      Parameters

      • Optional validateSession: boolean = true

      Returns Promise<SchoolYear[]>

    • Get all status data known by WebUntis

      +

      Parameters

      • Optional validateSession: boolean = true

      Returns Promise<StatusData>

    • Get all known students by WebUntis

      +

      Parameters

      • Optional validateSession: boolean = true

      Returns Promise<Student[]>

    • Get all known Subjects for the current logged-in user

      +

      Parameters

      • Optional validateSession: boolean = true

      Returns Promise<Subject[]>

    • Get all known teachers by WebUntis

      +

      Parameters

      • Optional validateSession: boolean = true

      Returns Promise<Teacher[]>

    • Get the timegrid of current school

      +

      Parameters

      • Optional validateSession: boolean = true

      Returns Promise<Timegrid[]>

    • 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 of today for a specific element.

      +

      Parameters

      • 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

      +
    • 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>

    • Logout the current session

      -

      Returns Promise<boolean>

    • Checks if your current WebUntis Session is valid

      -

      Returns Promise<boolean>

    • Convert a JS Date Object to a WebUntis date string

      -

      Parameters

      • date: Date

      Returns string

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

      +

      Returns Promise<SessionInformation>

    • Logout the current session

      +

      Returns Promise<boolean>

    • Checks if your current WebUntis Session is valid

      +

      Returns Promise<boolean>

    • Convert a JS Date Object to a WebUntis date string

      +

      Parameters

      • date: Date

      Returns string

    • 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

      +

    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

    \ No newline at end of file +

    Returns Date

    Static

    Generated using TypeDoc

    \ No newline at end of file diff --git a/docs/classes/WebUntisAnonymousAuth.html b/docs/classes/WebUntisAnonymousAuth.html index 61839c0..daad231 100644 --- a/docs/classes/WebUntisAnonymousAuth.html +++ b/docs/classes/WebUntisAnonymousAuth.html @@ -1,4 +1,4 @@ -WebUntisAnonymousAuth | webuntis

    Class WebUntisAnonymousAuth

    Hierarchy (view full)

    Constructors

    constructor +WebUntisAnonymousAuth | webuntis

    Class WebUntisAnonymousAuth

    Hierarchy (view full)

    Constructors

    Properties

    Constructors

    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

    • Parameters

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

      Returns Promise<SessionInformation>

    • Private

      Make a JSON RPC Request with the current session

      +

    Returns WebUntisAnonymousAuth

    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

    • 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 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 News Widget

      +
    • 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 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 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 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.

      +
    • 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 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

      +
    • 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

      +

    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

    \ No newline at end of file +

    Returns Date

    Static

    Generated using TypeDoc

    \ No newline at end of file diff --git a/docs/classes/WebUntisQR.html b/docs/classes/WebUntisQR.html index c22c173..7ce9b38 100644 --- a/docs/classes/WebUntisQR.html +++ b/docs/classes/WebUntisQR.html @@ -1,4 +1,4 @@ -WebUntisQR | webuntis

    Class WebUntisQR

    Hierarchy (view full)

    Constructors

    constructor +WebUntisQR | webuntis

    Class WebUntisQR

    Hierarchy (view full)

    Constructors

    Properties

    anonymous axios baseurl @@ -58,65 +58,65 @@
  • 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

      +

    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 News Widget

      +
    • 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.

      +
    • 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

      +
    • 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

      +

      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

      +

    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

    \ No newline at end of file +

    Returns Date

    Static

    Generated using TypeDoc

    \ No newline at end of file diff --git a/docs/classes/WebUntisSecretAuth.html b/docs/classes/WebUntisSecretAuth.html index c210fff..d84dbca 100644 --- a/docs/classes/WebUntisSecretAuth.html +++ b/docs/classes/WebUntisSecretAuth.html @@ -1,4 +1,4 @@ -WebUntisSecretAuth | webuntis

    Class WebUntisSecretAuth

    Hierarchy (view full)

    Constructors

    constructor +WebUntisSecretAuth | webuntis

    Class WebUntisSecretAuth

    Hierarchy (view full)

    Constructors

    Properties

    anonymous authenticator axios @@ -59,65 +59,65 @@
  • Optional identity: string = 'Awesome'

    A identity like: MyAwesomeApp

  • authenticator: Authenticator<AuthenticatorOptions<string>>

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

  • Optional disableUserAgent: boolean = false

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

    -
  • Returns WebUntisSecretAuth

    Properties

    anonymous: boolean
    authenticator: Authenticator<AuthenticatorOptions<string>>
    axios: AxiosInstance
    baseurl: string
    cookies: string[]
    id: string
    password: string
    school: string
    schoolbase64: string
    secret: string
    sessionInformation: null | SessionInformation
    username: string
    TYPES: typeof WebUntisElementType = WebUntisElementType

    Methods

    • Parameters

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

      Returns Promise<SessionInformation>

    • Private

      Make a JSON RPC Request with the current session

      +

    Returns WebUntisSecretAuth

    Properties

    anonymous: boolean
    authenticator: Authenticator<AuthenticatorOptions<string>>
    axios: AxiosInstance
    baseurl: string
    cookies: string[]
    id: string
    password: string
    school: string
    schoolbase64: string
    secret: string
    sessionInformation: null | SessionInformation
    username: string
    TYPES: typeof WebUntisElementType = WebUntisElementType

    Methods

    • 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 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 News Widget

      +
    • 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 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 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 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.

      +
    • 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 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

      +
    • 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

      +

    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

    \ No newline at end of file +

    Returns Date

    Static

    Generated using TypeDoc

    \ No newline at end of file diff --git a/docs/enums/WebUntisDay.html b/docs/enums/WebUntisDay.html index c597182..27799c4 100644 --- a/docs/enums/WebUntisDay.html +++ b/docs/enums/WebUntisDay.html @@ -1,8 +1,8 @@ -WebUntisDay | webuntis

    Enumeration WebUntisDay

    Enumeration Members

    Friday +WebUntisDay | webuntis

    Enumeration WebUntisDay

    Enumeration Members

    Friday: 6
    Monday: 2
    Saturday: 7
    Sunday: 1
    Thursday: 5
    Tuesday: 3
    Wednesday: 4

    Generated using TypeDoc

    \ No newline at end of file +

    Enumeration Members

    Friday: 6
    Monday: 2
    Saturday: 7
    Sunday: 1
    Thursday: 5
    Tuesday: 3
    Wednesday: 4

    Generated using TypeDoc

    \ No newline at end of file diff --git a/docs/enums/WebUntisElementType.html b/docs/enums/WebUntisElementType.html index 4386e01..1fccd68 100644 --- a/docs/enums/WebUntisElementType.html +++ b/docs/enums/WebUntisElementType.html @@ -1,6 +1,6 @@ -WebUntisElementType | webuntis

    Enumeration WebUntisElementType

    Enumeration Members

    CLASS +WebUntisElementType | webuntis

    Enumeration WebUntisElementType

    Enumeration Members

    Enumeration Members

    CLASS: 1
    ROOM: 4
    STUDENT: 5
    SUBJECT: 3
    TEACHER: 2

    Generated using TypeDoc

    \ No newline at end of file +

    Enumeration Members

    CLASS: 1
    ROOM: 4
    STUDENT: 5
    SUBJECT: 3
    TEACHER: 2

    Generated using TypeDoc

    \ No newline at end of file diff --git a/docs/interfaces/Absence.html b/docs/interfaces/Absence.html index 20bfd49..4a438eb 100644 --- a/docs/interfaces/Absence.html +++ b/docs/interfaces/Absence.html @@ -1,4 +1,4 @@ -Absence | webuntis

    Interface Absence

    interface Absence {
        canEdit: boolean;
        createDate: number;
        createdUser: string;
        endDate: number;
        endTime: number;
        excuse: Excuse;
        excuseStatus: string;
        id: number;
        interruptions: [];
        isExcused: boolean;
        lastUpdate: number;
        reason: string;
        reasonId: number;
        startDate: number;
        startTime: number;
        studentName: string;
        text: string;
        updatedUser: string;
    }

    Properties

    canEdit +Absence | webuntis

    Interface Absence

    interface Absence {
        canEdit: boolean;
        createDate: number;
        createdUser: string;
        endDate: number;
        endTime: number;
        excuse: Excuse;
        excuseStatus: string;
        id: number;
        interruptions: [];
        isExcused: boolean;
        lastUpdate: number;
        reason: string;
        reasonId: number;
        startDate: number;
        startTime: number;
        studentName: string;
        text: string;
        updatedUser: string;
    }

    Properties

    canEdit: boolean
    createDate: number
    createdUser: string
    endDate: number
    endTime: number
    excuse: Excuse
    excuseStatus: string
    id: number
    interruptions: []
    isExcused: boolean
    lastUpdate: number
    reason: string
    reasonId: number
    startDate: number
    startTime: number
    studentName: string
    text: string
    updatedUser: string

    Generated using TypeDoc

    \ No newline at end of file +

    Properties

    canEdit: boolean
    createDate: number
    createdUser: string
    endDate: number
    endTime: number
    excuse: Excuse
    excuseStatus: string
    id: number
    interruptions: []
    isExcused: boolean
    lastUpdate: number
    reason: string
    reasonId: number
    startDate: number
    startTime: number
    studentName: string
    text: string
    updatedUser: string

    Generated using TypeDoc

    \ No newline at end of file diff --git a/docs/interfaces/Absences.html b/docs/interfaces/Absences.html index 5f14cd8..e8676ae 100644 --- a/docs/interfaces/Absences.html +++ b/docs/interfaces/Absences.html @@ -1,6 +1,6 @@ -Absences | webuntis

    Interface Absences

    interface Absences {
        absenceReasons: [];
        absences: Absence[];
        excuseStatuses: boolean;
        showAbsenceReasonChange: boolean;
        showCreateAbsence: boolean;
    }

    Properties

    absenceReasons +Absences | webuntis

    Interface Absences

    interface Absences {
        absenceReasons: [];
        absences: Absence[];
        excuseStatuses: boolean;
        showAbsenceReasonChange: boolean;
        showCreateAbsence: boolean;
    }

    Properties

    absenceReasons: []
    absences: Absence[]
    excuseStatuses: boolean
    showAbsenceReasonChange: boolean
    showCreateAbsence: boolean

    Generated using TypeDoc

    \ No newline at end of file +

    Properties

    absenceReasons: []
    absences: Absence[]
    excuseStatuses: boolean
    showAbsenceReasonChange: boolean
    showCreateAbsence: boolean

    Generated using TypeDoc

    \ No newline at end of file diff --git a/docs/interfaces/CodesEntity.html b/docs/interfaces/CodesEntity.html index a88c641..90c6373 100644 --- a/docs/interfaces/CodesEntity.html +++ b/docs/interfaces/CodesEntity.html @@ -1,3 +1,3 @@ -CodesEntity | webuntis

    Interface CodesEntity

    interface CodesEntity {
        cancelled?: null | ColorEntity;
        irregular?: null | ColorEntity;
    }

    Properties

    cancelled? +CodesEntity | webuntis

    Interface CodesEntity

    interface CodesEntity {
        cancelled?: null | ColorEntity;
        irregular?: null | ColorEntity;
    }

    Properties

    cancelled?: null | ColorEntity
    irregular?: null | ColorEntity

    Generated using TypeDoc

    \ No newline at end of file +

    Properties

    cancelled?: null | ColorEntity
    irregular?: null | ColorEntity

    Generated using TypeDoc

    \ No newline at end of file diff --git a/docs/interfaces/ColorEntity.html b/docs/interfaces/ColorEntity.html index 2650e43..adf9313 100644 --- a/docs/interfaces/ColorEntity.html +++ b/docs/interfaces/ColorEntity.html @@ -1,3 +1,3 @@ -ColorEntity | webuntis

    Interface ColorEntity

    interface ColorEntity {
        backColor: string;
        foreColor: string;
    }

    Properties

    backColor +ColorEntity | webuntis

    Interface ColorEntity

    interface ColorEntity {
        backColor: string;
        foreColor: string;
    }

    Properties

    Properties

    backColor: string
    foreColor: string

    Generated using TypeDoc

    \ No newline at end of file +

    Properties

    backColor: string
    foreColor: string

    Generated using TypeDoc

    \ No newline at end of file diff --git a/docs/interfaces/Department.html b/docs/interfaces/Department.html index 1d1c371..f1805b6 100644 --- a/docs/interfaces/Department.html +++ b/docs/interfaces/Department.html @@ -1,4 +1,4 @@ -Department | webuntis

    Interface Department

    interface Department {
        id: number;
        longName: string;
        name: string;
    }

    Properties

    id +Department | webuntis

    Interface Department

    interface Department {
        id: number;
        longName: string;
        name: string;
    }

    Properties

    Properties

    id: number
    longName: string
    name: string

    Generated using TypeDoc

    \ No newline at end of file +

    Properties

    id: number
    longName: string
    name: string

    Generated using TypeDoc

    \ No newline at end of file diff --git a/docs/interfaces/Exam.html b/docs/interfaces/Exam.html index b14ada9..76b1be7 100644 --- a/docs/interfaces/Exam.html +++ b/docs/interfaces/Exam.html @@ -1,4 +1,4 @@ -Exam | webuntis

    Interface Exam

    interface Exam {
        assignedStudents: {
            displayName: string;
            id: number;
            klasse: {
                id: number;
                name: string;
            };
        }[];
        endTime: number;
        examDate: number;
        examType: string;
        grade?: string;
        id: number;
        name: string;
        rooms: string[];
        startTime: number;
        studentClass: string[];
        subject: string;
        teachers: string[];
        text: string;
    }

    Properties

    assignedStudents +Exam | webuntis

    Interface Exam

    interface Exam {
        assignedStudents: {
            displayName: string;
            id: number;
            klasse: {
                id: number;
                name: string;
            };
        }[];
        endTime: number;
        examDate: number;
        examType: string;
        grade?: string;
        id: number;
        name: string;
        rooms: string[];
        startTime: number;
        studentClass: string[];
        subject: string;
        teachers: string[];
        text: string;
    }

    Properties

    assignedStudents: {
        displayName: string;
        id: number;
        klasse: {
            id: number;
            name: string;
        };
    }[]

    Type declaration

    • displayName: string
    • id: number
    • klasse: {
          id: number;
          name: string;
      }
      • id: number
      • name: string
    endTime: number
    examDate: number
    examType: string
    grade?: string
    id: number
    name: string
    rooms: string[]
    startTime: number
    studentClass: string[]
    subject: string
    teachers: string[]
    text: string

    Generated using TypeDoc

    \ No newline at end of file +

    Properties

    assignedStudents: {
        displayName: string;
        id: number;
        klasse: {
            id: number;
            name: string;
        };
    }[]

    Type declaration

    • displayName: string
    • id: number
    • klasse: {
          id: number;
          name: string;
      }
      • id: number
      • name: string
    endTime: number
    examDate: number
    examType: string
    grade?: string
    id: number
    name: string
    rooms: string[]
    startTime: number
    studentClass: string[]
    subject: string
    teachers: string[]
    text: string

    Generated using TypeDoc

    \ No newline at end of file diff --git a/docs/interfaces/Excuse.html b/docs/interfaces/Excuse.html index 12c76bc..b83eccc 100644 --- a/docs/interfaces/Excuse.html +++ b/docs/interfaces/Excuse.html @@ -1,8 +1,8 @@ -Excuse | webuntis

    Interface Excuse

    interface Excuse {
        excuseDate: number;
        excuseStatus: string;
        id: number;
        isExcused: boolean;
        text: string;
        userId: number;
        username: string;
    }

    Properties

    excuseDate +Excuse | webuntis

    Interface Excuse

    interface Excuse {
        excuseDate: number;
        excuseStatus: string;
        id: number;
        isExcused: boolean;
        text: string;
        userId: number;
        username: string;
    }

    Properties

    excuseDate: number
    excuseStatus: string
    id: number
    isExcused: boolean
    text: string
    userId: number
    username: string

    Generated using TypeDoc

    \ No newline at end of file +

    Properties

    excuseDate: number
    excuseStatus: string
    id: number
    isExcused: boolean
    text: string
    userId: number
    username: string

    Generated using TypeDoc

    \ No newline at end of file diff --git a/docs/interfaces/Holiday.html b/docs/interfaces/Holiday.html index 2184e86..5de79d6 100644 --- a/docs/interfaces/Holiday.html +++ b/docs/interfaces/Holiday.html @@ -1,6 +1,6 @@ -Holiday | webuntis

    Interface Holiday

    interface Holiday {
        endDate: number;
        id: number;
        longName: string;
        name: string;
        startDate: number;
    }

    Properties

    endDate +Holiday | webuntis

    Interface Holiday

    interface Holiday {
        endDate: number;
        id: number;
        longName: string;
        name: string;
        startDate: number;
    }

    Properties

    endDate: number
    id: number
    longName: string
    name: string
    startDate: number

    Generated using TypeDoc

    \ No newline at end of file +

    Properties

    endDate: number
    id: number
    longName: string
    name: string
    startDate: number

    Generated using TypeDoc

    \ No newline at end of file diff --git a/docs/interfaces/Homework.html b/docs/interfaces/Homework.html index 0cc3ae2..3ad9f40 100644 --- a/docs/interfaces/Homework.html +++ b/docs/interfaces/Homework.html @@ -1,4 +1,4 @@ -Homework | webuntis

    Interface Homework

    interface Homework {
        attachments: any[];
        completed: boolean;
        date: number;
        dueDate: number;
        id: number;
        lessonId: number;
        remark: string;
        text: string;
    }

    Properties

    attachments +Homework | webuntis

    Interface Homework

    interface Homework {
        attachments: any[];
        completed: boolean;
        date: number;
        dueDate: number;
        id: number;
        lessonId: number;
        remark: string;
        text: string;
    }

    Properties

    Properties

    attachments: any[]

    Unknown type. I have never seen this in use.

    -
    completed: boolean
    date: number
    dueDate: number
    id: number
    lessonId: number
    remark: string
    text: string

    Generated using TypeDoc

    \ No newline at end of file +
    completed: boolean
    date: number
    dueDate: number
    id: number
    lessonId: number
    remark: string
    text: string

    Generated using TypeDoc

    \ No newline at end of file diff --git a/docs/interfaces/Inbox.html b/docs/interfaces/Inbox.html index 86d81a3..d8759b7 100644 --- a/docs/interfaces/Inbox.html +++ b/docs/interfaces/Inbox.html @@ -1,2 +1,2 @@ -Inbox | webuntis

    Interface Inbox

    interface Inbox {
        incomingMessages: Inboxmessage[];
    }

    Properties

    Properties

    incomingMessages: Inboxmessage[]

    Generated using TypeDoc

    \ No newline at end of file +Inbox | webuntis

    Interface Inbox

    interface Inbox {
        incomingMessages: Inboxmessage[];
    }

    Properties

    Properties

    incomingMessages: Inboxmessage[]

    Generated using TypeDoc

    \ No newline at end of file diff --git a/docs/interfaces/Inboxmessage.html b/docs/interfaces/Inboxmessage.html index e40ecd6..6af1359 100644 --- a/docs/interfaces/Inboxmessage.html +++ b/docs/interfaces/Inboxmessage.html @@ -1,4 +1,4 @@ -Inboxmessage | webuntis

    Interface Inboxmessage

    interface Inboxmessage {
        allowMessageDeletion: boolean;
        contentPreview: string;
        hasAttachments: boolean;
        id: number;
        isMessageRead: boolean;
        isReply: boolean;
        isReplyAllowed: boolean;
        sender: Messagesender;
        sentDateTime: string;
        subject: string;
    }

    Properties

    allowMessageDeletion +Inboxmessage | webuntis

    Interface Inboxmessage

    interface Inboxmessage {
        allowMessageDeletion: boolean;
        contentPreview: string;
        hasAttachments: boolean;
        id: number;
        isMessageRead: boolean;
        isReply: boolean;
        isReplyAllowed: boolean;
        sender: Messagesender;
        sentDateTime: string;
        subject: string;
    }

    Properties

    allowMessageDeletion: boolean
    contentPreview: string
    hasAttachments: boolean
    id: number
    isMessageRead: boolean
    isReply: boolean
    isReplyAllowed: boolean
    sentDateTime: string
    subject: string

    Generated using TypeDoc

    \ No newline at end of file +

    Properties

    allowMessageDeletion: boolean
    contentPreview: string
    hasAttachments: boolean
    id: number
    isMessageRead: boolean
    isReply: boolean
    isReplyAllowed: boolean
    sentDateTime: string
    subject: string

    Generated using TypeDoc

    \ No newline at end of file diff --git a/docs/interfaces/Klasse.html b/docs/interfaces/Klasse.html index c1f8957..8d5e343 100644 --- a/docs/interfaces/Klasse.html +++ b/docs/interfaces/Klasse.html @@ -1,4 +1,4 @@ -Klasse | webuntis

    Interface Klasse

    interface Klasse {
        active: boolean;
        backColor?: string;
        did?: number;
        foreColor?: string;
        id: number;
        longName: string;
        name: string;
        teacher1?: number;
        teacher2?: number;
    }

    Properties

    active +Klasse | webuntis

    Interface Klasse

    interface Klasse {
        active: boolean;
        backColor?: string;
        did?: number;
        foreColor?: string;
        id: number;
        longName: string;
        name: string;
        teacher1?: number;
        teacher2?: number;
    }

    Properties

    active: boolean
    backColor?: string
    did?: number
    foreColor?: string
    id: number
    longName: string
    name: string
    teacher1?: number
    teacher2?: number

    Generated using TypeDoc

    \ No newline at end of file +

    Properties

    active: boolean
    backColor?: string
    did?: number
    foreColor?: string
    id: number
    longName: string
    name: string
    teacher1?: number
    teacher2?: number

    Generated using TypeDoc

    \ No newline at end of file diff --git a/docs/interfaces/Lesson.html b/docs/interfaces/Lesson.html index a7c8d70..b04fb9c 100644 --- a/docs/interfaces/Lesson.html +++ b/docs/interfaces/Lesson.html @@ -1,4 +1,4 @@ -Lesson | webuntis

    Interface Lesson

    interface Lesson {
        activityType?: string;
        bkRemark?: string;
        bkText?: string;
        code?: "cancelled" | "irregular";
        date: number;
        endTime: number;
        id: number;
        info?: string;
        kl: ShortData[];
        lsnumber: number;
        lstext?: string;
        ro: ShortData[];
        sg?: string;
        startTime: number;
        statflags?: string;
        su: ShortData[];
        substText?: string;
        te: ShortData[];
    }

    Properties

    activityType? +Lesson | webuntis

    Interface Lesson

    interface Lesson {
        activityType?: string;
        bkRemark?: string;
        bkText?: string;
        code?: "cancelled" | "irregular";
        date: number;
        endTime: number;
        id: number;
        info?: string;
        kl: ShortData[];
        lsnumber: number;
        lstext?: string;
        ro: ShortData[];
        sg?: string;
        startTime: number;
        statflags?: string;
        su: ShortData[];
        substText?: string;
        te: ShortData[];
    }

    Properties

    Properties

    activityType?: string
    bkRemark?: string
    bkText?: string
    code?: "cancelled" | "irregular"
    date: number
    endTime: number
    id: number
    info?: string
    kl: ShortData[]
    lsnumber: number
    lstext?: string
    ro: ShortData[]
    sg?: string
    startTime: number
    statflags?: string
    su: ShortData[]
    substText?: string
    te: ShortData[]

    Generated using TypeDoc

    \ No newline at end of file +

    Properties

    activityType?: string
    bkRemark?: string
    bkText?: string
    code?: "cancelled" | "irregular"
    date: number
    endTime: number
    id: number
    info?: string
    kl: ShortData[]
    lsnumber: number
    lstext?: string
    ro: ShortData[]
    sg?: string
    startTime: number
    statflags?: string
    su: ShortData[]
    substText?: string
    te: ShortData[]

    Generated using TypeDoc

    \ No newline at end of file diff --git a/docs/interfaces/LsEntity.html b/docs/interfaces/LsEntity.html index 86e6645..2959cd0 100644 --- a/docs/interfaces/LsEntity.html +++ b/docs/interfaces/LsEntity.html @@ -1,6 +1,6 @@ -LsEntity | webuntis

    Interface LsEntity

    interface LsEntity {
        bs?: null | ColorEntity;
        ex?: null | ColorEntity;
        ls?: null | ColorEntity;
        oh?: null | ColorEntity;
        sb?: null | ColorEntity;
    }

    Properties

    bs? +LsEntity | webuntis

    Interface LsEntity

    interface LsEntity {
        bs?: null | ColorEntity;
        ex?: null | ColorEntity;
        ls?: null | ColorEntity;
        oh?: null | ColorEntity;
        sb?: null | ColorEntity;
    }

    Properties

    Properties

    bs?: null | ColorEntity
    ex?: null | ColorEntity
    ls?: null | ColorEntity
    oh?: null | ColorEntity
    sb?: null | ColorEntity

    Generated using TypeDoc

    \ No newline at end of file +

    Properties

    bs?: null | ColorEntity
    ex?: null | ColorEntity
    ls?: null | ColorEntity
    oh?: null | ColorEntity
    sb?: null | ColorEntity

    Generated using TypeDoc

    \ No newline at end of file diff --git a/docs/interfaces/MessagesOfDay.html b/docs/interfaces/MessagesOfDay.html index 597eabe..9e2aaa7 100644 --- a/docs/interfaces/MessagesOfDay.html +++ b/docs/interfaces/MessagesOfDay.html @@ -1,7 +1,7 @@ -MessagesOfDay | webuntis

    Interface MessagesOfDay

    interface MessagesOfDay {
        attachments: any[];
        id: number;
        isExpanded: boolean;
        subject: string;
        text: string;
    }

    Properties

    attachments +MessagesOfDay | webuntis

    Interface MessagesOfDay

    interface MessagesOfDay {
        attachments: any[];
        id: number;
        isExpanded: boolean;
        subject: string;
        text: string;
    }

    Properties

    attachments: any[]

    Unknown type. I have never seen this in use.

    -
    id: number
    isExpanded: boolean
    subject: string
    text: string

    Generated using TypeDoc

    \ No newline at end of file +
    id: number
    isExpanded: boolean
    subject: string
    text: string

    Generated using TypeDoc

    \ No newline at end of file diff --git a/docs/interfaces/Messagesender.html b/docs/interfaces/Messagesender.html index 7342a10..c8b4df1 100644 --- a/docs/interfaces/Messagesender.html +++ b/docs/interfaces/Messagesender.html @@ -1,5 +1,5 @@ -Messagesender | webuntis

    Interface Messagesender

    interface Messagesender {
        className: string;
        displayName: string;
        imageUrl: string;
        userId: number;
    }

    Properties

    className +Messagesender | webuntis

    Interface Messagesender

    interface Messagesender {
        className: string;
        displayName: string;
        imageUrl: string;
        userId: number;
    }

    Properties

    className: string
    displayName: string
    imageUrl: string
    userId: number

    Generated using TypeDoc

    \ No newline at end of file +

    Properties

    className: string
    displayName: string
    imageUrl: string
    userId: number

    Generated using TypeDoc

    \ No newline at end of file diff --git a/docs/interfaces/NewsWidget.html b/docs/interfaces/NewsWidget.html index eb91fbb..1cdd8c8 100644 --- a/docs/interfaces/NewsWidget.html +++ b/docs/interfaces/NewsWidget.html @@ -1,5 +1,5 @@ -NewsWidget | webuntis

    Interface NewsWidget

    interface NewsWidget {
        messagesOfDay: MessagesOfDay[];
        rssUrl: string;
        systemMessage: any;
    }

    Properties

    messagesOfDay +NewsWidget | webuntis

    Interface NewsWidget

    interface NewsWidget {
        messagesOfDay: MessagesOfDay[];
        rssUrl: string;
        systemMessage: any;
    }

    Properties

    messagesOfDay: MessagesOfDay[]
    rssUrl: string
    systemMessage: any

    Unknown type. I have never seen this in use.

    -

    Generated using TypeDoc

    \ No newline at end of file +

    Properties

    messagesOfDay: MessagesOfDay[]
    rssUrl: string
    systemMessage: any

    Unknown type. I have never seen this in use.

    +

    Generated using TypeDoc

    \ No newline at end of file diff --git a/docs/interfaces/Room.html b/docs/interfaces/Room.html index 93ae3d8..be1cc38 100644 --- a/docs/interfaces/Room.html +++ b/docs/interfaces/Room.html @@ -1,8 +1,8 @@ -Room | webuntis

    Interface Room

    interface Room {
        active: boolean;
        alternateName: string;
        backColor: string;
        foreColor: string;
        id: number;
        longName: string;
        name: string;
    }

    Properties

    active +Room | webuntis

    Interface Room

    interface Room {
        active: boolean;
        alternateName: string;
        backColor: string;
        foreColor: string;
        id: number;
        longName: string;
        name: string;
    }

    Properties

    active: boolean
    alternateName: string
    backColor: string
    foreColor: string
    id: number
    longName: string
    name: string

    Generated using TypeDoc

    \ No newline at end of file +

    Properties

    active: boolean
    alternateName: string
    backColor: string
    foreColor: string
    id: number
    longName: string
    name: string

    Generated using TypeDoc

    \ No newline at end of file diff --git a/docs/interfaces/SchoolYear.html b/docs/interfaces/SchoolYear.html index 3a32b1e..33a6e58 100644 --- a/docs/interfaces/SchoolYear.html +++ b/docs/interfaces/SchoolYear.html @@ -1,5 +1,5 @@ -SchoolYear | webuntis

    Interface SchoolYear

    interface SchoolYear {
        endDate: Date;
        id: number;
        name: string;
        startDate: Date;
    }

    Properties

    endDate +SchoolYear | webuntis

    Interface SchoolYear

    interface SchoolYear {
        endDate: Date;
        id: number;
        name: string;
        startDate: Date;
    }

    Properties

    Properties

    endDate: Date
    id: number
    name: string
    startDate: Date

    Generated using TypeDoc

    \ No newline at end of file +

    Properties

    endDate: Date
    id: number
    name: string
    startDate: Date

    Generated using TypeDoc

    \ No newline at end of file diff --git a/docs/interfaces/ShortData.html b/docs/interfaces/ShortData.html index a5cb5fc..d39b277 100644 --- a/docs/interfaces/ShortData.html +++ b/docs/interfaces/ShortData.html @@ -1,6 +1,6 @@ -ShortData | webuntis

    Interface ShortData

    interface ShortData {
        id: number;
        longname: string;
        name: string;
        orgid?: number;
        orgname?: string;
    }

    Properties

    id +ShortData | webuntis

    Interface ShortData

    interface ShortData {
        id: number;
        longname: string;
        name: string;
        orgid?: number;
        orgname?: string;
    }

    Properties

    id: number
    longname: string
    name: string
    orgid?: number
    orgname?: string

    Generated using TypeDoc

    \ No newline at end of file +

    Properties

    id: number
    longname: string
    name: string
    orgid?: number
    orgname?: string

    Generated using TypeDoc

    \ No newline at end of file diff --git a/docs/interfaces/StatusData.html b/docs/interfaces/StatusData.html index e654de2..0d0a2f7 100644 --- a/docs/interfaces/StatusData.html +++ b/docs/interfaces/StatusData.html @@ -1,3 +1,3 @@ -StatusData | webuntis

    Interface StatusData

    interface StatusData {
        codes: CodesEntity[];
        lstypes: LsEntity[];
    }

    Properties

    codes +StatusData | webuntis

    Interface StatusData

    interface StatusData {
        codes: CodesEntity[];
        lstypes: LsEntity[];
    }

    Properties

    Properties

    codes: CodesEntity[]
    lstypes: LsEntity[]

    Generated using TypeDoc

    \ No newline at end of file +

    Properties

    codes: CodesEntity[]
    lstypes: LsEntity[]

    Generated using TypeDoc

    \ No newline at end of file diff --git a/docs/interfaces/Student.html b/docs/interfaces/Student.html index 07e8c92..71d60ce 100644 --- a/docs/interfaces/Student.html +++ b/docs/interfaces/Student.html @@ -1,7 +1,7 @@ -Student | webuntis

    Interface Student

    interface Student {
        foreName: string;
        gender: string;
        id: number;
        key: number;
        longName: string;
        name: string;
    }

    Properties

    foreName +Student | webuntis

    Interface Student

    interface Student {
        foreName: string;
        gender: string;
        id: number;
        key: number;
        longName: string;
        name: string;
    }

    Properties

    foreName: string
    gender: string
    id: number
    key: number
    longName: string
    name: string

    Generated using TypeDoc

    \ No newline at end of file +

    Properties

    foreName: string
    gender: string
    id: number
    key: number
    longName: string
    name: string

    Generated using TypeDoc

    \ No newline at end of file diff --git a/docs/interfaces/Subject.html b/docs/interfaces/Subject.html index c2d381f..c0532cc 100644 --- a/docs/interfaces/Subject.html +++ b/docs/interfaces/Subject.html @@ -1,8 +1,8 @@ -Subject | webuntis

    Interface Subject

    interface Subject {
        active: boolean;
        alternateName: string;
        backColor: string;
        foreColor: string;
        id: number;
        longName: string;
        name: string;
    }

    Properties

    active +Subject | webuntis

    Interface Subject

    interface Subject {
        active: boolean;
        alternateName: string;
        backColor: string;
        foreColor: string;
        id: number;
        longName: string;
        name: string;
    }

    Properties

    active: boolean
    alternateName: string
    backColor: string
    foreColor: string
    id: number
    longName: string
    name: string

    Generated using TypeDoc

    \ No newline at end of file +

    Properties

    active: boolean
    alternateName: string
    backColor: string
    foreColor: string
    id: number
    longName: string
    name: string

    Generated using TypeDoc

    \ No newline at end of file diff --git a/docs/interfaces/Teacher.html b/docs/interfaces/Teacher.html index 5783445..20220c9 100644 --- a/docs/interfaces/Teacher.html +++ b/docs/interfaces/Teacher.html @@ -1,7 +1,7 @@ -Teacher | webuntis

    Interface Teacher

    interface Teacher {
        backColor: string;
        foreColor: string;
        foreName: string;
        id: number;
        longName: string;
        name: string;
    }

    Properties

    backColor +Teacher | webuntis

    Interface Teacher

    interface Teacher {
        backColor: string;
        foreColor: string;
        foreName: string;
        id: number;
        longName: string;
        name: string;
    }

    Properties

    backColor: string
    foreColor: string
    foreName: string
    id: number
    longName: string
    name: string

    Generated using TypeDoc

    \ No newline at end of file +

    Properties

    backColor: string
    foreColor: string
    foreName: string
    id: number
    longName: string
    name: string

    Generated using TypeDoc

    \ No newline at end of file diff --git a/docs/interfaces/TimeUnit.html b/docs/interfaces/TimeUnit.html index 357b3f3..5a09b66 100644 --- a/docs/interfaces/TimeUnit.html +++ b/docs/interfaces/TimeUnit.html @@ -1,4 +1,4 @@ -TimeUnit | webuntis

    Interface TimeUnit

    interface TimeUnit {
        endTime: number;
        name: string;
        startTime: number;
    }

    Properties

    endTime +TimeUnit | webuntis

    Interface TimeUnit

    interface TimeUnit {
        endTime: number;
        name: string;
        startTime: number;
    }

    Properties

    Properties

    endTime: number
    name: string
    startTime: number

    Generated using TypeDoc

    \ No newline at end of file +

    Properties

    endTime: number
    name: string
    startTime: number

    Generated using TypeDoc

    \ No newline at end of file diff --git a/docs/interfaces/Timegrid.html b/docs/interfaces/Timegrid.html index 033b039..6a37398 100644 --- a/docs/interfaces/Timegrid.html +++ b/docs/interfaces/Timegrid.html @@ -1,3 +1,3 @@ -Timegrid | webuntis

    Interface Timegrid

    interface Timegrid {
        day: WebUntisDay;
        timeUnits: TimeUnit[];
    }

    Properties

    day +Timegrid | webuntis

    Interface Timegrid

    interface Timegrid {
        day: WebUntisDay;
        timeUnits: TimeUnit[];
    }

    Properties

    Properties

    timeUnits: TimeUnit[]

    Generated using TypeDoc

    \ No newline at end of file +

    Properties

    timeUnits: TimeUnit[]

    Generated using TypeDoc

    \ No newline at end of file diff --git a/docs/interfaces/WebAPITimetable.html b/docs/interfaces/WebAPITimetable.html index 7a29829..668cf11 100644 --- a/docs/interfaces/WebAPITimetable.html +++ b/docs/interfaces/WebAPITimetable.html @@ -1,4 +1,4 @@ -WebAPITimetable | webuntis

    Interface WebAPITimetable

    interface WebAPITimetable {
        cellState: "STANDARD" | "SUBSTITUTION" | "ROOMSUBSTITUTION";
        classes: WebElementData[];
        code: number;
        date: number;
        elements: WebElement[];
        endTime: number;
        hasInfo: boolean;
        hasPeriodText: false;
        id: number;
        is: {
            event: boolean;
            roomSubstitution?: boolean;
            standard?: boolean;
            substitution?: boolean;
        };
        lessonCode: string;
        lessonId: number;
        lessonNumber: number;
        lessonText: string;
        periodAttachments: [];
        periodInfo: string;
        periodText: string;
        priority: number;
        roomCapacity: number;
        rooms: WebElementData[];
        startTime: number;
        studentCount: number;
        studentGroup: string;
        students: WebElementData[];
        subjects: WebElementData[];
        substText: string;
        teachers: WebElementData[];
    }

    Properties

    cellState +WebAPITimetable | webuntis

    Interface WebAPITimetable

    interface WebAPITimetable {
        cellState: "STANDARD" | "SUBSTITUTION" | "ROOMSUBSTITUTION";
        classes: WebElementData[];
        code: number;
        date: number;
        elements: WebElement[];
        endTime: number;
        hasInfo: boolean;
        hasPeriodText: false;
        id: number;
        is: {
            event: boolean;
            roomSubstitution?: boolean;
            standard?: boolean;
            substitution?: boolean;
        };
        lessonCode: string;
        lessonId: number;
        lessonNumber: number;
        lessonText: string;
        periodAttachments: [];
        periodInfo: string;
        periodText: string;
        priority: number;
        roomCapacity: number;
        rooms: WebElementData[];
        startTime: number;
        studentCount: number;
        studentGroup: string;
        students: WebElementData[];
        subjects: WebElementData[];
        substText: string;
        teachers: WebElementData[];
    }

    Properties

    Properties

    cellState: "STANDARD" | "SUBSTITUTION" | "ROOMSUBSTITUTION"
    classes: WebElementData[]
    code: number
    date: number
    elements: WebElement[]
    endTime: number
    hasInfo: boolean
    hasPeriodText: false
    id: number
    is: {
        event: boolean;
        roomSubstitution?: boolean;
        standard?: boolean;
        substitution?: boolean;
    }

    Type declaration

    • event: boolean
    • Optional roomSubstitution?: boolean
    • Optional standard?: boolean
    • Optional substitution?: boolean
    lessonCode: string
    lessonId: number
    lessonNumber: number
    lessonText: string
    periodAttachments: []
    periodInfo: string
    periodText: string
    priority: number
    roomCapacity: number
    startTime: number
    studentCount: number
    studentGroup: string
    students: WebElementData[]
    subjects: WebElementData[]
    substText: string
    teachers: WebElementData[]

    Generated using TypeDoc

    \ No newline at end of file +

    Properties

    cellState: "STANDARD" | "SUBSTITUTION" | "ROOMSUBSTITUTION"
    classes: WebElementData[]
    code: number
    date: number
    elements: WebElement[]
    endTime: number
    hasInfo: boolean
    hasPeriodText: false
    id: number
    is: {
        event: boolean;
        roomSubstitution?: boolean;
        standard?: boolean;
        substitution?: boolean;
    }

    Type declaration

    • event: boolean
    • Optional roomSubstitution?: boolean
    • Optional standard?: boolean
    • Optional substitution?: boolean
    lessonCode: string
    lessonId: number
    lessonNumber: number
    lessonText: string
    periodAttachments: []
    periodInfo: string
    periodText: string
    priority: number
    roomCapacity: number
    startTime: number
    studentCount: number
    studentGroup: string
    students: WebElementData[]
    subjects: WebElementData[]
    substText: string
    teachers: WebElementData[]

    Generated using TypeDoc

    \ No newline at end of file diff --git a/docs/interfaces/WebElement.html b/docs/interfaces/WebElement.html index f5b36ae..32c244d 100644 --- a/docs/interfaces/WebElement.html +++ b/docs/interfaces/WebElement.html @@ -1,6 +1,6 @@ -WebElement | webuntis

    Interface WebElement

    interface WebElement {
        id: number;
        missing: boolean;
        orgId: number;
        state: "REGULAR" | "ABSENT" | "SUBSTITUTED";
        type: WebUntisElementType;
    }

    Hierarchy (view full)

    Properties

    id +WebElement | webuntis

    Interface WebElement

    interface WebElement {
        id: number;
        missing: boolean;
        orgId: number;
        state: "REGULAR" | "ABSENT" | "SUBSTITUTED";
        type: WebUntisElementType;
    }

    Hierarchy (view full)

    Properties

    Properties

    id: number
    missing: boolean
    orgId: number
    state: "REGULAR" | "ABSENT" | "SUBSTITUTED"

    Generated using TypeDoc

    \ No newline at end of file +

    Properties

    id: number
    missing: boolean
    orgId: number
    state: "REGULAR" | "ABSENT" | "SUBSTITUTED"

    Generated using TypeDoc

    \ No newline at end of file diff --git a/docs/interfaces/WebElementData.html b/docs/interfaces/WebElementData.html index 52fe184..6eff39a 100644 --- a/docs/interfaces/WebElementData.html +++ b/docs/interfaces/WebElementData.html @@ -1,7 +1,7 @@ -WebElementData | webuntis

    Interface WebElementData

    interface WebElementData {
        element: {
            alternatename?: string;
            canViewTimetable: boolean;
            displayname?: string;
            externalKey?: string;
            id: number;
            longName?: string;
            name: string;
            roomCapacity: number;
            type: number;
        };
        id: number;
        missing: boolean;
        orgId: number;
        state: "REGULAR" | "ABSENT" | "SUBSTITUTED";
        type: WebUntisElementType;
    }

    Hierarchy (view full)

    Properties

    element +WebElementData | webuntis

    Interface WebElementData

    interface WebElementData {
        element: {
            alternatename?: string;
            canViewTimetable: boolean;
            displayname?: string;
            externalKey?: string;
            id: number;
            longName?: string;
            name: string;
            roomCapacity: number;
            type: number;
        };
        id: number;
        missing: boolean;
        orgId: number;
        state: "REGULAR" | "ABSENT" | "SUBSTITUTED";
        type: WebUntisElementType;
    }

    Hierarchy (view full)

    Properties

    element: {
        alternatename?: string;
        canViewTimetable: boolean;
        displayname?: string;
        externalKey?: string;
        id: number;
        longName?: string;
        name: string;
        roomCapacity: number;
        type: number;
    }

    Type declaration

    • Optional alternatename?: string
    • canViewTimetable: boolean
    • Optional displayname?: string
    • Optional externalKey?: string
    • id: number
    • Optional longName?: string
    • name: string
    • roomCapacity: number
    • type: number
    id: number
    missing: boolean
    orgId: number
    state: "REGULAR" | "ABSENT" | "SUBSTITUTED"

    Generated using TypeDoc

    \ No newline at end of file +

    Properties

    element: {
        alternatename?: string;
        canViewTimetable: boolean;
        displayname?: string;
        externalKey?: string;
        id: number;
        longName?: string;
        name: string;
        roomCapacity: number;
        type: number;
    }

    Type declaration

    • Optional alternatename?: string
    • canViewTimetable: boolean
    • Optional displayname?: string
    • Optional externalKey?: string
    • id: number
    • Optional longName?: string
    • name: string
    • roomCapacity: number
    • type: number
    id: number
    missing: boolean
    orgId: number
    state: "REGULAR" | "ABSENT" | "SUBSTITUTED"

    Generated using TypeDoc

    \ No newline at end of file diff --git a/docs/types/Authenticator.html b/docs/types/Authenticator.html index 7726c4d..1babf8a 100644 --- a/docs/types/Authenticator.html +++ b/docs/types/Authenticator.html @@ -1 +1 @@ -Authenticator | webuntis

    Generated using TypeDoc

    \ No newline at end of file +Authenticator | webuntis

    Generated using TypeDoc

    \ No newline at end of file diff --git a/docs/types/URLClass.html b/docs/types/URLClass.html index 7c7eb68..d2dcd1a 100644 --- a/docs/types/URLClass.html +++ b/docs/types/URLClass.html @@ -1 +1 @@ -URLClass | webuntis

    Generated using TypeDoc

    \ No newline at end of file +URLClass | webuntis

    Generated using TypeDoc

    \ No newline at end of file