| import Mark from "./mark"; | ||
| export default class MarkClass { | ||
| public id: number; | ||
| public code: string; | ||
| public name: string; | ||
| public professors: string[]; | ||
| public average: number; | ||
| public credits: { | ||
| obtained: number, | ||
| total: number | ||
| }; | ||
| public validated: boolean; | ||
| public marks: Mark[] = []; | ||
| constructor(data: any) { | ||
| this.id = data.id; | ||
| this.code = data.cours_code; | ||
| this.name = data.cours_libelle; | ||
| this.professors = data.intervenants.split(', '); | ||
| this.average = parseFloat(data.inscription_cours.moyenne); | ||
| this.credits = { | ||
| obtained: parseInt(data.inscription_cours.nombre_credits_obtenus), | ||
| total: parseInt(data.inscription_cours.nombre_credits_potentiels) | ||
| } | ||
| this.validated = data.inscription_cours.validated; | ||
| this.marks = data.epreuves.map((mark: any) => new Mark(mark)); | ||
| } | ||
| toJSON() { | ||
| return { | ||
| id: this.id, | ||
| code: this.code, | ||
| name: this.name, | ||
| professors: this.professors, | ||
| average: this.average, | ||
| credits: this.credits, | ||
| validated: this.validated, | ||
| marks: this.marks.map(mark => mark.toJSON()) | ||
| } | ||
| } | ||
| } |
| export default class Mark { | ||
| public id: string; | ||
| public name: string; | ||
| public startDate: Date; | ||
| public obtentionDate: Date; | ||
| public professors: string[]; | ||
| public value: number; | ||
| public appreciation: string; | ||
| public absence: boolean; | ||
| public notRated: boolean; | ||
| constructor(data: any) { | ||
| this.id = data.id; | ||
| this.name = data.libelle; | ||
| this.startDate = new Date(data.date_debut_evt); | ||
| this.obtentionDate = new Date(data.date_obtention); | ||
| this.professors = data.intervenants.split(', '); | ||
| this.value = parseFloat(data.note); | ||
| this.appreciation = data.appreciation; | ||
| this.absence = data.est_absent; | ||
| this.notRated = data.est_non_noter; | ||
| } | ||
| toJSON() { | ||
| return { | ||
| id: this.id, | ||
| name: this.name, | ||
| startDate: this.startDate, | ||
| obtentionDate: this.obtentionDate, | ||
| professors: this.professors, | ||
| value: this.value, | ||
| absence: this.absence, | ||
| notRated: this.notRated | ||
| } | ||
| } | ||
| } |
+5
-1
| { | ||
| "name": "aurion", | ||
| "version": "1.0.0", | ||
| "version": "1.0.1", | ||
| "description": "Client for Aurion API, a french school management software", | ||
@@ -8,2 +8,6 @@ "main": "./dist/index.js", | ||
| "types": "./dist/index.d.ts", | ||
| "repository": { | ||
| "type": "git", | ||
| "url": "https://github.com/revoverflow/aurion.js" | ||
| }, | ||
| "scripts": { | ||
@@ -10,0 +14,0 @@ "build": "tsup", |
+1
-1
@@ -38,3 +38,3 @@ # Aurion.js | ||
| - [x] Timetable | ||
| - [ ] Grades | ||
| - [x] Grades | ||
| - [ ] Absences |
| import axios, { AxiosInstance } from "axios"; | ||
| import { ClientOptions, Tokens } from "../types/client"; | ||
| import TimetableEntry from "../models/timetable_entry"; | ||
| import MarkClass from "../models/mark_class"; | ||
@@ -35,3 +37,3 @@ export default class AurionClient { | ||
| console.log(this.tokens); | ||
| return; | ||
| } | ||
@@ -49,6 +51,7 @@ | ||
| async getMarks(): Promise<any> { | ||
| async getMarks(): Promise<MarkClass[]> { | ||
| const response = await this.client.get('/mes_notes'); | ||
| const result = response.data.map((mark: any) => new MarkClass(mark)); | ||
| return response.data; | ||
| return result; | ||
| } | ||
@@ -58,6 +61,7 @@ | ||
| const response = await this.client.get('/mes_absences'); | ||
| const result = response.data; | ||
| return response.data; | ||
| return result; | ||
| } | ||
| } |
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
20683
14.76%10
25%272
37.37%0
-100%