mirror of
https://github.com/dd060606/WebAurion-API.git
synced 2026-03-18 21:50:38 +01:00
fix: npm link
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import { getViewState } from "../utils/AurionUtils";
|
||||
import { getNotesFromResponse } from "../utils/NotesUtils";
|
||||
import { NotesList } from "../utils/types";
|
||||
import Session from "./Session";
|
||||
|
||||
class NotesApi {
|
||||
@@ -20,6 +21,8 @@ class NotesApi {
|
||||
);
|
||||
resolve(getNotesFromResponse(response));
|
||||
} catch (error) {
|
||||
// En cas d'erreur, on supprime le cache de ViewState
|
||||
this.session.clearViewStateCache();
|
||||
reject(error);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import { getJSFFormParams, getViewState } from "../utils/AurionUtils";
|
||||
import { planningResponseToEvents } from "../utils/PlanningUtils";
|
||||
import { PlanningEvent } from "../utils/types";
|
||||
import Session from "./Session";
|
||||
|
||||
class PlanningApi {
|
||||
@@ -56,6 +57,8 @@ class PlanningApi {
|
||||
);
|
||||
resolve(planningResponseToEvents(response));
|
||||
} catch (error) {
|
||||
// En cas d'erreur, on supprime le cache de ViewState
|
||||
this.session.clearViewStateCache();
|
||||
reject(error);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
export { default as Session } from "./api/Session";
|
||||
export * from "./api/Session";
|
||||
export * from "./utils/AurionUtils";
|
||||
export * from "./utils/NotesUtils";
|
||||
export * from "./utils/PlanningUtils";
|
||||
export * from "./utils/types";
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { load } from "cheerio";
|
||||
import { Note, NotesList } from "./types";
|
||||
|
||||
export function getNotesFromResponse(htmlReponse: string): NotesList[] {
|
||||
// On parcourt le tableau des notes
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { load } from "cheerio";
|
||||
import { PlanningEvent } from "./types";
|
||||
|
||||
// Conversion du calendrier au format JSON
|
||||
export function getJSONSchedule(xml: string): object {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
type PlanningEvent = {
|
||||
export type PlanningEvent = {
|
||||
id: string;
|
||||
title: string;
|
||||
subject: string;
|
||||
@@ -9,7 +9,7 @@ type PlanningEvent = {
|
||||
end: string;
|
||||
className: string;
|
||||
};
|
||||
type Note = {
|
||||
export type Note = {
|
||||
date: string;
|
||||
code: string;
|
||||
subject: string;
|
||||
@@ -19,7 +19,7 @@ type Note = {
|
||||
instructor: string;
|
||||
[key: string]: string;
|
||||
};
|
||||
type NotesList = {
|
||||
export type NotesList = {
|
||||
code: string;
|
||||
notes: Note[];
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user