fix: npm link

This commit is contained in:
dd060606
2024-11-23 10:44:34 +01:00
parent 0f1df15630
commit d7e807d04d
10 changed files with 1391 additions and 8 deletions

View File

@@ -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);
}
});

View File

@@ -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);
}
});

View File

@@ -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";

View File

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

View File

@@ -1,4 +1,5 @@
import { load } from "cheerio";
import { PlanningEvent } from "./types";
// Conversion du calendrier au format JSON
export function getJSONSchedule(xml: string): object {

View File

@@ -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[];
};