@studentsphere/ots-provider-wigor 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md ADDED
@@ -0,0 +1,99 @@
1
+ <div align="center">
2
+ <img src=".github/assets/logo.png" alt="OTS Logo" width="350" />
3
+ <h1>@studentsphere/ots-provider-wigor</h1>
4
+ </div>
5
+
6
+ The official Wigor Timetable implementation of an Open Timetable Scraper (OTS) provider
7
+
8
+ This provider specializes in extracting and retrieving data from Wigor-based school portals. It automates the connection and parsing of Wigor timetables, converting raw HTML into a clean, standardized format for the Open Timetable Scrapper ecosystem.
9
+
10
+ ## Installation
11
+
12
+ ```bash
13
+ npm install @studentsphere/ots-provider-wigor
14
+ ```
15
+
16
+ ## Features
17
+
18
+ - **Wigor System Support**: Specifically designed to interface with Wigor-based timetable portals.
19
+ - **CAS Authentication**: Automatically handles Central Authentication Service (CAS) login flows.
20
+ - **Multi-School Support**: Built-in support for numerous schools and campuses using the Wigor system.
21
+ - **Standardized Output**: Converts complex HTML timetable grids into clean, standardized `Course` objects defined by `@studentsphere/ots-core`.
22
+
23
+ ## Usage
24
+
25
+ To use the Wigor provider in your application, instantiate the `WigorProvider` class. You can then validate user credentials and fetch their schedule.
26
+
27
+ ```typescript
28
+ import { WigorProvider } from "@studentsphere/ots-provider-wigor";
29
+
30
+ const provider = new WigorProvider();
31
+
32
+ // 1. Validate credentials
33
+ const isValid = await provider.validateCredentials({
34
+ identifier: "student_username",
35
+ password: "student_password"
36
+ });
37
+
38
+ if (isValid) {
39
+ // 2. Fetch the schedule for a specific date range
40
+ const fromDate = new Date("2026-10-01T00:00:00Z");
41
+ const toDate = new Date("2026-10-31T23:59:59Z");
42
+
43
+ const courses = await provider.getSchedule(
44
+ {
45
+ identifier: "student_username",
46
+ password: "student_password"
47
+ },
48
+ fromDate,
49
+ toDate
50
+ );
51
+
52
+ console.log(courses);
53
+ }
54
+ ```
55
+
56
+ ## Supported C&D and IGENSIA Education Schools
57
+
58
+ | Logo | Institution |
59
+ | ---------------------------------------------------------------------------- | -------------------------- |
60
+ | <img src=".github/assets/schools/3a.png" width="50"> | 3A |
61
+ | <img src=".github/assets/schools/epsi.png" width="50"> | EPSI |
62
+ | <img src=".github/assets/schools/esail.png" width="50"> | ESAIL |
63
+ | <img src=".github/assets/schools/icl.png" width="50"> | ICL |
64
+ | <img src=".github/assets/schools/idrac_business_school.png" width="50"> | IDRAC Business School |
65
+ | <img src=".github/assets/schools/ieft.png" width="50"> | IEFT |
66
+ | <img src=".github/assets/schools/iet.png" width="50"> | IET |
67
+ | <img src=".github/assets/schools/ifag.png" width="50"> | IFAG |
68
+ | <img src=".github/assets/schools/igefi.png" width="50"> | IGEFI |
69
+ | <img src=".github/assets/schools/ihedrea.png" width="50"> | IHEDREA |
70
+ | <img src=".github/assets/schools/ileri.png" width="50"> | ILERI |
71
+ | <img src=".github/assets/schools/sup_de_com.png" width="50"> | SUP' DE COM |
72
+ | <img src=".github/assets/schools/viva_mundi.png" width="50"> | VIVA MUNDI |
73
+ | <img src=".github/assets/schools/wis.png" width="50"> | WIS |
74
+ | <img src=".github/assets/schools/american_business_college.png" width="50"> | American Business College |
75
+ | <img src=".github/assets/schools/esam.png" width="50"> | ESAM |
76
+ | <img src=".github/assets/schools/icd_business_school.png" width="50"> | ICD BUSINESS SCHOOL |
77
+ | <img src=".github/assets/schools/igensia_rh.png" width="50"> | IGENSIA RH |
78
+ | <img src=".github/assets/schools/imis.png" width="50"> | IMIS |
79
+ | <img src=".github/assets/schools/imsi.png" width="50"> | IMSI |
80
+ | <img src=".github/assets/schools/ipi.png" width="50"> | IPI |
81
+ | <img src=".github/assets/schools/iscpa.png" width="50"> | ISCPA |
82
+ | <img src=".github/assets/schools/ismm.png" width="50"> | ISMM |
83
+ | <img src=".github/assets/schools/cnva.png" width="50"> | CNVA |
84
+ | <img src=".github/assets/schools/business_science_institute.png" width="50"> | Business Science Institute |
85
+ | <img src=".github/assets/schools/ecm.png" width="50"> | ECM |
86
+ | <img src=".github/assets/schools/emi.png" width="50"> | EMI |
87
+ | <img src=".github/assets/schools/esa.png" width="50"> | ESA |
88
+
89
+ ## Dependencies
90
+
91
+ This provider relies on several key packages to function:
92
+ - `axios` & `axios-cookiejar-support`: For handling HTTP requests and maintaining session cookies.
93
+ - `cheerio`: For parsing and extracting data from the Wigor HTML timetable grids.
94
+ - `tough-cookie`: For robust cookie management during the authentication flow.
95
+ - `p-limit`: For managing concurrency when fetching multiple weeks of schedule data.
96
+
97
+ ## License
98
+
99
+ MIT
@@ -0,0 +1,36 @@
1
+ import { BaseTimetableProvider, type Course, type ProviderCredentials, type School } from "@studentsphere/ots-core";
2
+ export interface WigorEvent {
3
+ title: string;
4
+ instructor: string;
5
+ program: string;
6
+ startTime: string;
7
+ endTime: string;
8
+ duration: number;
9
+ weekDay: string;
10
+ classroom: string | null;
11
+ campus: string | null;
12
+ deliveryMode: string;
13
+ color: string;
14
+ classGroup: string;
15
+ hash: string;
16
+ }
17
+ export declare class WigorProvider extends BaseTimetableProvider {
18
+ get id(): string;
19
+ get name(): string;
20
+ get logo(): string;
21
+ get schools(): School[];
22
+ validateCredentials(credentials: ProviderCredentials): Promise<boolean>;
23
+ getSchedule(credentials: ProviderCredentials, from: Date, to: Date): Promise<Course[]>;
24
+ private checkCasAvailability;
25
+ private extractHiddenFields;
26
+ private createClient;
27
+ private isErrorPage;
28
+ private fetchEDTHtml;
29
+ private capitalizeName;
30
+ private parseFrenchDate;
31
+ private getMonday;
32
+ private addDays;
33
+ private calculateDuration;
34
+ private parseEdtHtml;
35
+ private areEventsValid;
36
+ }