Skip to content

Latest commit

 

History

History
562 lines (309 loc) · 21.4 KB

Edulink_Raw.md

File metadata and controls

562 lines (309 loc) · 21.4 KB

edulink-api / Exports / Edulink_Raw

Class: Edulink_Raw

This class houses all the raw requests to the Edulink API. Properties that the methods require need to initialized with the Edulink_Raw.initialize method.

Table of contents

Constructors

Properties

Accessors

Methods

Constructors

constructor

new Edulink_Raw()

Properties

generic_header

Private generic_header: Object

This houses the authentication bearer

Type declaration

Name Type
Authorization string

Defined in

Raw_Edulink_Requests/Edulink_Raw.ts:50


learner_id

learner_id: string

The ID of the current signed in user

Defined in

Raw_Edulink_Requests/Edulink_Raw.ts:40


school_server

school_server: string

The base server that requests are made to

Defined in

Raw_Edulink_Requests/Edulink_Raw.ts:45

Accessors

generic_data

Private get generic_data(): Object

This returns some fields needed in the data section of the other requests

Returns

Object

Name Type
id string
jsonrpc string
uuid string

Defined in

Raw_Edulink_Requests/Edulink_Raw.ts:74

Methods

Achievement

Achievement(): Promise<Edulink_Achievement>

Returns the data from the achievements section of edulink

Returns

Promise<Edulink_Achievement>

A promise that resolves to the Edulink_Achievement response

Defined in

Raw_Edulink_Requests/Edulink_Raw.ts:250


AchievementBehaviourLookups

AchievementBehaviourLookups(): Promise<Edulink_AchievementBehaviourLookups>

Gets a look up table for the Edulink_Achievement and Edulink_Behaviour responses

Returns

Promise<Edulink_AchievementBehaviourLookups>

A promise that resolves to the Edulink_AchievementBehaviourLookups response, this is a look up table for the Edulink_Achievement and Edulink_Behaviour responses

Defined in

Raw_Edulink_Requests/Edulink_Raw.ts:198


Attendance

Attendance(): Promise<Edulink_Attendance>

Returns the data from the attendance section of edulink

Returns

Promise<Edulink_Attendance>

A promise that resolves to the Edulink_Attendance response

Defined in

Raw_Edulink_Requests/Edulink_Raw.ts:277


Behaviour

Behaviour(): Promise<Edulink_Behaviour>

Gets the results from the Behaviour section of edulink

Returns

Promise<Edulink_Behaviour>

A promise that resolves to the Edulink_Behaviour response

Defined in

Raw_Edulink_Requests/Edulink_Raw.ts:170


Catering

Catering(): Promise<Edulink_Catering>

Returns the data from the catering section of edulink

Returns

Promise<Edulink_Catering>

A promise that resolves to the Edulink_Catering response

Defined in

Raw_Edulink_Requests/Edulink_Raw.ts:305


Clubs

Clubs(member?): Promise<Edulink_Clubs>

Returns the data from the clubs section of edulink

Parameters

Name Type Default value Description
member boolean true If true clubs that the learner is a member of will be returned, if false clubs that the learner is not a member of will be returned

Returns

Promise<Edulink_Clubs>

A promise that resolves to the Edulink_Clubs response

Defined in

Raw_Edulink_Requests/Edulink_Raw.ts:460


Documents

Documents(): Promise<Edulink_Documents>

Gets the results from the documents section of edulink

Returns

Promise<Edulink_Documents>

A promise that resolves to the Edulink_Documents response

Defined in

Raw_Edulink_Requests/Edulink_Raw.ts:116


Exams

Exams(): Promise<Edulink_Exams>

Gets the results from the exams section of edulink

Returns

Promise<Edulink_Exams>

A promise that resolves to the Edulink_Exams response

Defined in

Raw_Edulink_Requests/Edulink_Raw.ts:143


ExternalLinks

ExternalLinks(): Promise<Edulink_ExternalLinks>

Returns the data from the external links section of edulink

Returns

Promise<Edulink_ExternalLinks>

A promise that resolves to the Edulink_ExternalLinks response

Defined in

Raw_Edulink_Requests/Edulink_Raw.ts:434


Homework

Homework(): Promise<Edulink_Homework>

Returns the data from the Homework section of edulink

Returns

Promise<Edulink_Homework>

A promise that resolves to the Edulink_Homework response

Defined in

Raw_Edulink_Requests/Edulink_Raw.ts:332


HomeworkCompleted

HomeworkCompleted(homework_id, homework_source, complete): Promise<any>

Change the completion status of a homework

Parameters

Name Type Description
homework_id number The id of the homework to change completion for
homework_source "SIMS" | "EduLink" -
complete boolean A boolean representing the homework's new completion status

Returns

Promise<any>

//TODO: Add return type

Defined in

Raw_Edulink_Requests/Edulink_Raw.ts:361


HomeworkDetails

HomeworkDetails(homework_id, source): Promise<Edulink_HomeworkDetails>

Request additional details about a homework

Parameters

Name Type Description
homework_id string | number The id of the homework to request details for
source "SIMS" | "EduLink" the way the homework was added normally through "SIMS" or "EduLink"

Returns

Promise<Edulink_HomeworkDetails>

A promise that resolves to the Edulink_HomeworkDetails response

Defined in

Raw_Edulink_Requests/Edulink_Raw.ts:400


Login

Login(username, password, establishment_id, server?): Promise<Edulink_Login>

Parameters

Name Type Description
username string The username that should be used for authentication
password string The password that should be used for authentication
establishment_id number The id of the establishment that the user is trying to authenticate against, this is provided in Edulink_SchoolDetails
server string The server to authenticate with.

Returns

Promise<Edulink_Login>

A promise that resolves to the Edulink_Login response, this response contains important data about room and group ids

Defined in

Raw_Edulink_Requests/Edulink_Raw.ts:624


Logout

Logout(): Promise<Edulink_Logout>

Logs the user out of the school server, this will render most of the class useless as authentication is required for the methods to run

Returns

Promise<Edulink_Logout>

A promise that resolves to the Edulink_Logout response

Defined in

Raw_Edulink_Requests/Edulink_Raw.ts:659


Personal

Personal(): Promise<Edulink_Personal>

Returns the data from the personal section of edulink

Returns

Promise<Edulink_Personal>

A promise that resolves to the Edulink_Personal response

Defined in

Raw_Edulink_Requests/Edulink_Raw.ts:488


Ping

Ping(): Promise<Edulink_Ping>

Ping's the server to keep the session alive //TODO: See how long the default session is and how long it should be

Returns

Promise<Edulink_Ping>

A promise that resolves to the Edulink_Ping response

Defined in

Raw_Edulink_Requests/Edulink_Raw.ts:684


RegisterCodes

RegisterCodes(): Promise<Edulink_RegisterCodes>

TODO: Can't remeber what this is

Returns

Promise<Edulink_RegisterCodes>

Defined in

Raw_Edulink_Requests/Edulink_Raw.ts:225


SchoolDetails

SchoolDetails(school_server?): Promise<Edulink_SchoolDetails>

Returns information about the login options of the school as well as the school name and id, see Edulink_SchoolDetails

Parameters

Name Type Description
school_server string The school_server to query information about

Returns

Promise<Edulink_SchoolDetails>

information about the login options of the school as well as the school name and id, see Edulink_SchoolDetails

Defined in

Raw_Edulink_Requests/Edulink_Raw.ts:569


School_FromCode

School_FromCode(school_code, server?): Promise<School_FromCode>

Returns a response that contains the school_code of a school from the school_server

Parameters

Name Type Default value Description
school_code string undefined
server string 'https://provisioning.edulinkone.com/' The server to use to find the school_code. This should always be the default unless you're debugging or something.

Returns

Promise<School_FromCode>

A promise that resolves to a response object that contains the school code and server.

Defined in

Raw_Edulink_Requests/Edulink_Raw.ts:599


Status

Status(): Promise<Edulink_Status>

Returns the current status of the user sign in as well as info about the user's upcoming whereabouts, see Edulink_Status

Returns

Promise<Edulink_Status>

A promise that resolves to the Edulink_Status response

Defined in

Raw_Edulink_Requests/Edulink_Raw.ts:515


Timetable

Timetable(date): Promise<Edulink_Timetable>

Gets the timetable for the current user from a given date

Parameters

Name Type Description
date string should be in format: YYYY-MM-DD, this is the start date of the range by default edulink will return 16 days of data //TODO: Fact check this is always true

Returns

Promise<Edulink_Timetable>

A promise that resolves to the Edulink_Attendance response

Defined in

Raw_Edulink_Requests/Edulink_Raw.ts:88


initialize

initialize(authtoken, learner_id, school_server): Promise<void>

Parameters

Name Type Description
authtoken string The authtoken to pass to requests, this is obtained from the Edulink_Login response
learner_id string The learner_id to pass to requests, this is obtained from the Edulink_Login response
school_server string The school_server to pass to requests, this is obtained from the Edulink_SchoolDetails response

Returns

Promise<void>

Defined in

Raw_Edulink_Requests/Edulink_Raw.ts:58