mirror of
https://github.com/dd060606/WebAurion-API.git
synced 2026-01-18 16:47:26 +01:00
fix: npm link
This commit is contained in:
1358
package-lock.json
generated
1358
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
12
package.json
12
package.json
@@ -1,9 +1,11 @@
|
||||
{
|
||||
"name": "webaurion-api",
|
||||
"version": "1.0.0",
|
||||
"main": "index.js",
|
||||
"main": "./dist/index.js",
|
||||
"module": "./dist/index.mjs",
|
||||
"types": "./dist/index.d.ts",
|
||||
"scripts": {
|
||||
"build": "tsc",
|
||||
"build": "tsup",
|
||||
"test": "jest",
|
||||
"lint": "eslint src --ext .ts"
|
||||
},
|
||||
@@ -22,6 +24,10 @@
|
||||
"prettier": "^3.3.3",
|
||||
"ts-jest": "^29.2.5",
|
||||
"ts-node": "^10.9.2",
|
||||
"tsup": "^8.3.5",
|
||||
"typescript": "^5.6.3"
|
||||
}
|
||||
},
|
||||
"files": [
|
||||
"dist/**/*"
|
||||
]
|
||||
}
|
||||
|
||||
@@ -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[];
|
||||
};
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"target": "ES6",
|
||||
"module": "CommonJS",
|
||||
"module": "ESNext",
|
||||
"outDir": "./dist",
|
||||
"strict": true,
|
||||
"esModuleInterop": true,
|
||||
|
||||
10
tsup.config.ts
Normal file
10
tsup.config.ts
Normal file
@@ -0,0 +1,10 @@
|
||||
import { defineConfig } from "tsup";
|
||||
|
||||
export default defineConfig({
|
||||
entry: ["src/index.ts"],
|
||||
format: ["cjs", "esm"],
|
||||
dts: true,
|
||||
splitting: false,
|
||||
sourcemap: true,
|
||||
clean: true,
|
||||
});
|
||||
Reference in New Issue
Block a user