Development: Backend: Code - zhaw-timetable/zhawo GitHub Wiki
-
CampusInfoAdapter
- CampusInfoAdapter.exports.getScheduleResource(route, name, startDate, days) ⇒
Promise - CampusInfoAdapter.exports.getPossibleNames(route) ⇒
Promise - CampusInfoAdapter.exports.getFacilities() ⇒
Promise - CampusInfoAdapter.exports.getMensaResource(facilityId, date) ⇒
Promise - CampusInfoAdapter.filterMenuPlansByFacilityId(menuPlans, facilityId) ⇒
- CampusInfoAdapter.exports.getScheduleResource(route, name, startDate, days) ⇒
- VszhawAdapter
- createFreeRoomsJson
Functions that handle all communication with CampusInfo Api.
Async Function that gets schedule for a given user starting at start date and for the given amount of days from the Campus Api.
Kind: static method of CampusInfoAdapter
Returns: Promise - On success the promise will be resolved with a JSON object.
On error the promise will be rejected with an { status: 404 }.
| Param | Type | Description |
|---|---|---|
| route | string |
|
| name | string |
|
| startDate | Date |
|
| days | number |
(default = 7) |
Async Function that get all the possible name for a given group (route) from the Campus Api.
Kind: static method of CampusInfoAdapter
Returns: Promise - On success the promise will be resolved with a JSON object.
On error the promise will be rejected.
| Param | Type | Description |
|---|---|---|
| route | string |
(lecturers / rooms / students) |
Async Function that gets a list of all the Mensa Facilities from the Campus Api.
Kind: static method of CampusInfoAdapter
Returns: Promise - On success the promise will be resolved with a JSON object.
On error the promise will be rejected.
Async Function that gets Mensa menus for a given facility from the Campus Api.
Kind: static method of CampusInfoAdapter
Returns: Promise - On success the promise will be resolved with a JSON object.
On error the promise will be rejected.
| Param | Type |
|---|---|
| facilityId | number |
| date | Date |
Function that filters a given list of menu plans for a facilityId.
Kind: static method of CampusInfoAdapter
Returns: Menu Plan
| Param | Type |
|---|---|
| menuPlans | * |
| facilityId | * |
Functions that handle all communication with the vszhaw webpage
Async Function that reads rss feed from vszhaw.ch
Kind: global function
Returns: Promise - On success the promise will be resolved with a list of articles.
Async Function that gets all vszhaw events for the current month.
Kind: global function
Returns: Promise - On success the promise will be resolved with an array.
Async Function that creates new freeRooms Object using createFreeRoomsObject and then writes it to a json file.
Default slots
Async Function that creates a Object that contains all free Rooms for current day.
Kind: global function
Returns: Object containing all free Rooms
Function used to write to log file.
| Param | Type |
|---|---|
| file | string |
| text | string |