@studentsphere/ots-provider-wigor 1.0.1 → 2.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 +1 -42
- package/dist/constants.d.ts +5 -0
- package/dist/constants.js +36 -0
- package/dist/constants.js.map +1 -0
- package/dist/index.d.ts +3 -26
- package/dist/index.js +245 -598
- package/dist/index.js.map +1 -1
- package/dist/schools.d.ts +2 -0
- package/dist/schools.js +143 -0
- package/dist/schools.js.map +1 -0
- package/dist/types.d.ts +38 -0
- package/dist/types.js +2 -0
- package/dist/types.js.map +1 -0
- package/dist/utils.d.ts +6 -0
- package/dist/utils.js +14 -0
- package/dist/utils.js.map +1 -0
- package/package.json +62 -69
- package/src/index.ts +382 -773
package/README.md
CHANGED
|
@@ -39,39 +39,6 @@ npm install @studentsphere/ots-provider-wigor
|
|
|
39
39
|
- **Multi-School Support**: Built-in support for numerous schools and campuses using the Wigor system.
|
|
40
40
|
- **Standardized Output**: Converts complex HTML timetable grids into clean, standardized `Course` objects defined by `@studentsphere/ots-core`.
|
|
41
41
|
|
|
42
|
-
## Usage
|
|
43
|
-
|
|
44
|
-
To use the Wigor provider in your application, instantiate the `WigorProvider` class. You can then validate user credentials and fetch their schedule.
|
|
45
|
-
|
|
46
|
-
```typescript
|
|
47
|
-
import { WigorProvider } from "@studentsphere/ots-provider-wigor";
|
|
48
|
-
|
|
49
|
-
const provider = new WigorProvider();
|
|
50
|
-
|
|
51
|
-
// 1. Validate credentials
|
|
52
|
-
const isValid = await provider.validateCredentials({
|
|
53
|
-
identifier: "student_username",
|
|
54
|
-
password: "student_password"
|
|
55
|
-
});
|
|
56
|
-
|
|
57
|
-
if (isValid) {
|
|
58
|
-
// 2. Fetch the schedule for a specific date range
|
|
59
|
-
const fromDate = new Date("2026-10-01T00:00:00Z");
|
|
60
|
-
const toDate = new Date("2026-10-31T23:59:59Z");
|
|
61
|
-
|
|
62
|
-
const courses = await provider.getSchedule(
|
|
63
|
-
{
|
|
64
|
-
identifier: "student_username",
|
|
65
|
-
password: "student_password"
|
|
66
|
-
},
|
|
67
|
-
fromDate,
|
|
68
|
-
toDate
|
|
69
|
-
);
|
|
70
|
-
|
|
71
|
-
console.log(courses);
|
|
72
|
-
}
|
|
73
|
-
```
|
|
74
|
-
|
|
75
42
|
## Supported C&D and IGENSIA Education Schools
|
|
76
43
|
|
|
77
44
|
| Logo | Institution |
|
|
@@ -105,14 +72,6 @@ if (isValid) {
|
|
|
105
72
|
| <img src=".github/assets/schools/emi.png" width="50"> | EMI |
|
|
106
73
|
| <img src=".github/assets/schools/esa.png" width="50"> | ESA |
|
|
107
74
|
|
|
108
|
-
## Dependencies
|
|
109
|
-
|
|
110
|
-
This provider relies on several key packages to function:
|
|
111
|
-
- `axios` & `axios-cookiejar-support`: For handling HTTP requests and maintaining session cookies.
|
|
112
|
-
- `cheerio`: For parsing and extracting data from the Wigor HTML timetable grids.
|
|
113
|
-
- `tough-cookie`: For robust cookie management during the authentication flow.
|
|
114
|
-
- `p-limit`: For managing concurrency when fetching multiple weeks of schedule data.
|
|
115
|
-
|
|
116
75
|
## License
|
|
117
76
|
|
|
118
|
-
MIT
|
|
77
|
+
MIT
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export declare const LOGIN_SERVER_ENDPOINT = "https://cas-p.wigorservices.net/cas/login";
|
|
2
|
+
export declare const CD_SCHOOLS_TIMETABLE_ENDPOINT = "https://ws-edt-cd.wigorservices.net/Home/Get";
|
|
3
|
+
export declare const IGENSIA_SCHOOLS_TIMETABLE_ENDPOINT = "https://ws-edt-igs.wigorservices.net/Home/Get";
|
|
4
|
+
export declare const CD_SCHOOLS: string[];
|
|
5
|
+
export declare const IGENSIA_SCHOOLS: string[];
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
export const LOGIN_SERVER_ENDPOINT = "https://cas-p.wigorservices.net/cas/login";
|
|
2
|
+
export const CD_SCHOOLS_TIMETABLE_ENDPOINT = "https://ws-edt-cd.wigorservices.net/Home/Get";
|
|
3
|
+
export const IGENSIA_SCHOOLS_TIMETABLE_ENDPOINT = "https://ws-edt-igs.wigorservices.net/Home/Get";
|
|
4
|
+
export const CD_SCHOOLS = [
|
|
5
|
+
"3a",
|
|
6
|
+
"epsi",
|
|
7
|
+
"esail",
|
|
8
|
+
"icl",
|
|
9
|
+
"idrac-business-school",
|
|
10
|
+
"ieft",
|
|
11
|
+
"iet",
|
|
12
|
+
"ifag",
|
|
13
|
+
"igefi",
|
|
14
|
+
"ihedrea",
|
|
15
|
+
"ileri",
|
|
16
|
+
"sup-de-com",
|
|
17
|
+
"viva-mundi",
|
|
18
|
+
"wis",
|
|
19
|
+
];
|
|
20
|
+
export const IGENSIA_SCHOOLS = [
|
|
21
|
+
"american-business-college",
|
|
22
|
+
"business-science-institute",
|
|
23
|
+
"cnva",
|
|
24
|
+
"ecm",
|
|
25
|
+
"emi",
|
|
26
|
+
"esa",
|
|
27
|
+
"esam",
|
|
28
|
+
"icd-business-school",
|
|
29
|
+
"igensia-rh",
|
|
30
|
+
"imis",
|
|
31
|
+
"imsi",
|
|
32
|
+
"ipi",
|
|
33
|
+
"iscpa",
|
|
34
|
+
"ismm",
|
|
35
|
+
];
|
|
36
|
+
//# sourceMappingURL=constants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,qBAAqB,GACjC,2CAA2C,CAAC;AAC7C,MAAM,CAAC,MAAM,6BAA6B,GACzC,8CAA8C,CAAC;AAChD,MAAM,CAAC,MAAM,kCAAkC,GAC9C,+CAA+C,CAAC;AAEjD,MAAM,CAAC,MAAM,UAAU,GAAG;IACzB,IAAI;IACJ,MAAM;IACN,OAAO;IACP,KAAK;IACL,uBAAuB;IACvB,MAAM;IACN,KAAK;IACL,MAAM;IACN,OAAO;IACP,SAAS;IACT,OAAO;IACP,YAAY;IACZ,YAAY;IACZ,KAAK;CACL,CAAC;AAEF,MAAM,CAAC,MAAM,eAAe,GAAG;IAC9B,2BAA2B;IAC3B,4BAA4B;IAC5B,MAAM;IACN,KAAK;IACL,KAAK;IACL,KAAK;IACL,MAAM;IACN,qBAAqB;IACrB,YAAY;IACZ,MAAM;IACN,MAAM;IACN,KAAK;IACL,OAAO;IACP,MAAM;CACN,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,19 +1,4 @@
|
|
|
1
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
2
|
export declare class WigorProvider extends BaseTimetableProvider {
|
|
18
3
|
get id(): string;
|
|
19
4
|
get name(): string;
|
|
@@ -21,16 +6,8 @@ export declare class WigorProvider extends BaseTimetableProvider {
|
|
|
21
6
|
get schools(): School[];
|
|
22
7
|
validateCredentials(credentials: ProviderCredentials): Promise<boolean>;
|
|
23
8
|
getSchedule(credentials: ProviderCredentials, from: Date, to: Date): Promise<Course[]>;
|
|
24
|
-
private
|
|
9
|
+
private login;
|
|
25
10
|
private extractHiddenFields;
|
|
26
|
-
private
|
|
27
|
-
private
|
|
28
|
-
private fetchEDTHtml;
|
|
29
|
-
private capitalizeName;
|
|
30
|
-
private parseFrenchDate;
|
|
31
|
-
private getMonday;
|
|
32
|
-
private addDays;
|
|
33
|
-
private calculateDuration;
|
|
34
|
-
private parseEdtHtml;
|
|
35
|
-
private areEventsValid;
|
|
11
|
+
private updateCookies;
|
|
12
|
+
private serializeCookies;
|
|
36
13
|
}
|