@studentsphere/linkgor 0.0.1-alpha
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/LICENSE +674 -0
- package/README.md +191 -0
- package/dist/index.d.mts +111 -0
- package/dist/index.d.ts +111 -0
- package/dist/index.js +369 -0
- package/dist/index.mjs +336 -0
- package/package.json +54 -0
package/README.md
ADDED
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
<img width="1500" height="375" alt="image" src=".github/assets/banner.svg" />
|
|
2
|
+
|
|
3
|
+
<p align="center">A <strong>wrapper</strong> for interacting with <strong>Wigor services.</strong></p>
|
|
4
|
+
<p align="center">
|
|
5
|
+
<a href="https://www.npmjs.com/package/@studentsphere/linkgor"><img src="https://img.shields.io/npm/v/@studentsphere/linkgor?style=flat-square&color=cb3837" alt="Linkgor version" /></a>
|
|
6
|
+
<a href="https://www.npmjs.com/package/@studentsphere/linkgor"><img src="https://img.shields.io/badge/Wigor_EDT-5.1.2-047187?style=flat-square" alt="Wigor timetable version" /></a>
|
|
7
|
+
<a href="https://www.typescriptlang.org/"><img src="https://img.shields.io/badge/TypeScript-007ACC?style=flat-square&logo=typescript&logoColor=white" alt="language" /></a>
|
|
8
|
+
</p>
|
|
9
|
+
|
|
10
|
+
`linkgor` is a modern, lightweight TypeScript wrapper designed to interact with WigorServices portals. It is exclusively compatible with schools from the **[Compétences & Développement (C&D)](https://www.competences-developpement.com)** and **[IGENSIA Education](https://www.igensia-education.fr)** groups.
|
|
11
|
+
|
|
12
|
+
- 🔑 **CAS Authentication**
|
|
13
|
+
- 📅 **Planning Retrieval**
|
|
14
|
+
- 👤 **Profile Parsing**
|
|
15
|
+
- 🪶 **Zero Dependencies**
|
|
16
|
+
- ⚡ **TypeScript First**
|
|
17
|
+
- 🏫 **Multi-School Support**
|
|
18
|
+
|
|
19
|
+
## Installation
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
### With pnpm
|
|
23
|
+
```bash
|
|
24
|
+
pnpm add @studentsphere/linkgor
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## Documentation
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
## Supported Schools
|
|
31
|
+
|
|
32
|
+
<table border="0">
|
|
33
|
+
<tr>
|
|
34
|
+
<td align="center" valign="top" width="20%">
|
|
35
|
+
<img src=".github/assets/schools/3a.png" width="50" alt="3A"><br>
|
|
36
|
+
<sub>3A</sub>
|
|
37
|
+
</td>
|
|
38
|
+
<td align="center" valign="top" width="20%">
|
|
39
|
+
<img src=".github/assets/schools/abcp.png" width="50" alt="American Business College"><br>
|
|
40
|
+
<sub>American Business College</sub>
|
|
41
|
+
</td>
|
|
42
|
+
<td align="center" valign="top" width="20%">
|
|
43
|
+
<img src=".github/assets/schools/bsi.png" width="50" alt="Business Science Institute"><br>
|
|
44
|
+
<sub>Business Science Institute</sub>
|
|
45
|
+
</td>
|
|
46
|
+
<td align="center" valign="top" width="20%">
|
|
47
|
+
<img src=".github/assets/schools/cnva.png" width="50" alt="CNVA"><br>
|
|
48
|
+
<sub>CNVA</sub>
|
|
49
|
+
</td>
|
|
50
|
+
<td align="center" valign="top" width="20%">
|
|
51
|
+
<img src=".github/assets/schools/ecm.png" width="50" alt="ECM"><br>
|
|
52
|
+
<sub>ECM</sub>
|
|
53
|
+
</td>
|
|
54
|
+
</tr>
|
|
55
|
+
<tr>
|
|
56
|
+
<td align="center" valign="top">
|
|
57
|
+
<img src=".github/assets/schools/emi.png" width="50" alt="EMI"><br>
|
|
58
|
+
<sub>EMI</sub>
|
|
59
|
+
</td>
|
|
60
|
+
<td align="center" valign="top">
|
|
61
|
+
<img src=".github/assets/schools/epsi.png" width="50" alt="EPSI"><br>
|
|
62
|
+
<sub>EPSI</sub>
|
|
63
|
+
</td>
|
|
64
|
+
<td align="center" valign="top">
|
|
65
|
+
<img src=".github/assets/schools/esa.png" width="50" alt="ESA"><br>
|
|
66
|
+
<sub>ESA</sub>
|
|
67
|
+
</td>
|
|
68
|
+
<td align="center" valign="top">
|
|
69
|
+
<img src=".github/assets/schools/esail.png" width="50" alt="ESAIL"><br>
|
|
70
|
+
<sub>ESAIL</sub>
|
|
71
|
+
</td>
|
|
72
|
+
<td align="center" valign="top">
|
|
73
|
+
<img src=".github/assets/schools/esam.png" width="50" alt="ESAM"><br>
|
|
74
|
+
<sub>ESAM</sub>
|
|
75
|
+
</td>
|
|
76
|
+
</tr>
|
|
77
|
+
<tr>
|
|
78
|
+
<td align="center" valign="top">
|
|
79
|
+
<img src=".github/assets/schools/icd.png" width="50" alt="ICD Business School"><br>
|
|
80
|
+
<sub>ICD Business School</sub>
|
|
81
|
+
</td>
|
|
82
|
+
<td align="center" valign="top">
|
|
83
|
+
<img src=".github/assets/schools/icl.png" width="50" alt="ICL"><br>
|
|
84
|
+
<sub>ICL</sub>
|
|
85
|
+
</td>
|
|
86
|
+
<td align="center" valign="top">
|
|
87
|
+
<img src=".github/assets/schools/idrac.png" width="50" alt="IDRAC Business School"><br>
|
|
88
|
+
<sub>IDRAC Business School</sub>
|
|
89
|
+
</td>
|
|
90
|
+
<td align="center" valign="top">
|
|
91
|
+
<img src=".github/assets/schools/ieft.png" width="50" alt="IEFT"><br>
|
|
92
|
+
<sub>IEFT</sub>
|
|
93
|
+
</td>
|
|
94
|
+
<td align="center" valign="top">
|
|
95
|
+
<img src=".github/assets/schools/iet.png" width="50" alt="IET"><br>
|
|
96
|
+
<sub>IET</sub>
|
|
97
|
+
</td>
|
|
98
|
+
</tr>
|
|
99
|
+
<tr>
|
|
100
|
+
<td align="center" valign="top">
|
|
101
|
+
<img src=".github/assets/schools/ifag.png" width="50" alt="IFAG"><br>
|
|
102
|
+
<sub>IFAG</sub>
|
|
103
|
+
</td>
|
|
104
|
+
<td align="center" valign="top">
|
|
105
|
+
<img src=".github/assets/schools/igefi.png" width="50" alt="IGEFI"><br>
|
|
106
|
+
<sub>IGEFI</sub>
|
|
107
|
+
</td>
|
|
108
|
+
<td align="center" valign="top">
|
|
109
|
+
<img src=".github/assets/schools/igensiarh.png" width="50" alt="IGENSIA RH"><br>
|
|
110
|
+
<sub>IGENSIA RH</sub>
|
|
111
|
+
</td>
|
|
112
|
+
<td align="center" valign="top">
|
|
113
|
+
<img src=".github/assets/schools/ihedrea.png" width="50" alt="IHEDREA"><br>
|
|
114
|
+
<sub>IHEDREA</sub>
|
|
115
|
+
</td>
|
|
116
|
+
<td align="center" valign="top">
|
|
117
|
+
<img src=".github/assets/schools/ileri.png" width="50" alt="ILERI"><br>
|
|
118
|
+
<sub>ILERI</sub>
|
|
119
|
+
</td>
|
|
120
|
+
</tr>
|
|
121
|
+
<tr>
|
|
122
|
+
<td align="center" valign="top">
|
|
123
|
+
<img src=".github/assets/schools/imis.png" width="50" alt="IMIS"><br>
|
|
124
|
+
<sub>IMIS</sub>
|
|
125
|
+
</td>
|
|
126
|
+
<td align="center" valign="top">
|
|
127
|
+
<img src=".github/assets/schools/imsi.png" width="50" alt="IMSI"><br>
|
|
128
|
+
<sub>IMSI</sub>
|
|
129
|
+
</td>
|
|
130
|
+
<td align="center" valign="top">
|
|
131
|
+
<img src=".github/assets/schools/ipi.png" width="50" alt="IPI"><br>
|
|
132
|
+
<sub>IPI</sub>
|
|
133
|
+
</td>
|
|
134
|
+
<td align="center" valign="top">
|
|
135
|
+
<img src=".github/assets/schools/iscpa.png" width="50" alt="ISCPA"><br>
|
|
136
|
+
<sub>ISCPA</sub>
|
|
137
|
+
</td>
|
|
138
|
+
<td align="center" valign="top">
|
|
139
|
+
<img src=".github/assets/schools/ismm.png" width="50" alt="ISMM"><br>
|
|
140
|
+
<sub>ISMM</sub>
|
|
141
|
+
</td>
|
|
142
|
+
</tr>
|
|
143
|
+
<tr>
|
|
144
|
+
<td align="center" valign="top">
|
|
145
|
+
<img src=".github/assets/schools/supdecom.png" width="50" alt="SUP DE COM"><br>
|
|
146
|
+
<sub>SUP DE COM</sub>
|
|
147
|
+
</td>
|
|
148
|
+
<td align="center" valign="top">
|
|
149
|
+
<img src=".github/assets/schools/vivamundi.png" width="50" alt="VIVA MUNDI"><br>
|
|
150
|
+
<sub>VIVA MUNDI</sub>
|
|
151
|
+
</td>
|
|
152
|
+
<td align="center" valign="top">
|
|
153
|
+
<img src=".github/assets/schools/wis.png" width="50" alt="WIS"><br>
|
|
154
|
+
<sub>WIS</sub>
|
|
155
|
+
</td>
|
|
156
|
+
<td width="20%"></td>
|
|
157
|
+
<td width="20%"></td>
|
|
158
|
+
</tr>
|
|
159
|
+
</table>
|
|
160
|
+
|
|
161
|
+
## Contributing
|
|
162
|
+
Please see [CONTRIBUTING](/CONTRIBUTING.md) in the repository for guidelines and best practices.
|
|
163
|
+
|
|
164
|
+
## License
|
|
165
|
+
`linkgor` is licensed under the [GNU General Public License v3.0](https://choosealicense.com/licenses/gpl-3.0/), allowing you to use, modify, and distribute it for both commercial and non-commercial purposes, provided that the license terms are respected. See the [LICENSE](/LICENSE) file for more details.
|
|
166
|
+
|
|
167
|
+
## Legalities
|
|
168
|
+
|
|
169
|
+
> [!CAUTION]
|
|
170
|
+
> **LEGAL DISCLAIMER**
|
|
171
|
+
>
|
|
172
|
+
> This project, `@studentsphere/linkgor`, is an independent open-source tool. It is **not affiliated with, authorized, maintained, sponsored, or endorsed** by the **[Compétences & Développement (C&D)](https://www.competences-developpement.com)** group, **[IGENSIA Education](https://www.igensia-education.fr)**, or the developers of the **[WigorServices](http://wigorservices.net)** platform.
|
|
173
|
+
>
|
|
174
|
+
> 1. **Intellectual Property:** All trademarks, logos, and brand names are the property of their respective owners. Their mention here is strictly for identification and compatibility purposes and does not imply any association.
|
|
175
|
+
> 2. **Responsible Use:** This tool is provided strictly to facilitate interoperability. The authors decline any liability for misuse, illegal activities, or malicious acts committed by users. You are solely responsible for ensuring your use of this tool complies with applicable laws and terms of service.
|
|
176
|
+
> 3. **No Warranty:** The software is provided "as is", without warranty of any kind. The developer assumes no liability for account suspensions, access blocks, or any legal actions taken by the aforementioned groups resulting from the use of this tool.
|
|
177
|
+
>
|
|
178
|
+
> **By using this package, you acknowledge and agree to these terms in full.**
|
|
179
|
+
|
|
180
|
+
This project is meant to help users interact with their own data while respecting French software laws ([Article L.122-6-1 of the French Intellectual Property Code](https://www.legifrance.gouv.fr/codes/article_lc/LEGIARTI000044365559)). It only does what’s needed to make the software work together with other tools, without copying, sharing, or changing the original software. This analysis is limited to what’s needed for interoperability and isn’t used for anything else.
|
|
181
|
+
|
|
182
|
+
For any legal questions or concerns regarding this project, contact: [contact@studentsphere.app](mailto:contact@studentsphere.app?subject=%5BStudentSphere%5D%20Legal%20Inquiry%20about%20Linkgor).
|
|
183
|
+
|
|
184
|
+
## Credits
|
|
185
|
+
|
|
186
|
+
- **[TypeScript](https://github.com/microsoft/TypeScript)** - [Apache-2.0 License](https://github.com/microsoft/TypeScript/blob/main/LICENSE.txt)
|
|
187
|
+
- **[tsup](https://github.com/egoist/tsup)** - [MIT License](https://github.com/egoist/tsup/blob/main/LICENSE)
|
|
188
|
+
- **[tsx](https://github.com/privatenumber/tsx)** - [MIT License](https://github.com/privatenumber/tsx/blob/main/LICENSE)
|
|
189
|
+
- **[TypeDoc](https://github.com/TypeDoc/typedoc)** - [Apache-2.0 License](https://github.com/TypeDoc/typedoc/blob/master/LICENSE)
|
|
190
|
+
- **[@inquirer/prompts](https://github.com/SBoudrias/Inquirer.js)** - [MIT License](https://github.com/SBoudrias/Inquirer.js/blob/master/LICENSE)
|
|
191
|
+
- **[Chalk](https://github.com/chalk/chalk)** - [MIT License](https://github.com/chalk/chalk/blob/main/license)
|
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
interface Lesson {
|
|
2
|
+
Commentaire: string | null;
|
|
3
|
+
NoCours: number;
|
|
4
|
+
NoGroupe: number;
|
|
5
|
+
LibelleGroupe: string | null;
|
|
6
|
+
LibelleSemaine: string | null;
|
|
7
|
+
Matiere: string | null;
|
|
8
|
+
Salles: string | null;
|
|
9
|
+
NomEcole: string | null;
|
|
10
|
+
LogoEcole: string | null;
|
|
11
|
+
CoursMixtePicto: string | null;
|
|
12
|
+
CoursMixteInfoBulle: string | null;
|
|
13
|
+
FondCour: string | null;
|
|
14
|
+
NomProf: string | null;
|
|
15
|
+
Duree: number | null;
|
|
16
|
+
RecurrenceRule: string | null;
|
|
17
|
+
RecurrenceID: string | null;
|
|
18
|
+
RecurrenceException: string | null;
|
|
19
|
+
IsAllDay: boolean;
|
|
20
|
+
Title: string | null;
|
|
21
|
+
Description: string | null;
|
|
22
|
+
Start: string;
|
|
23
|
+
StartTimezone: string | null;
|
|
24
|
+
End: string;
|
|
25
|
+
EndTimezone: string | null;
|
|
26
|
+
TeamsURL: string | null;
|
|
27
|
+
TeamsUrl: string | null;
|
|
28
|
+
ColorRed: number;
|
|
29
|
+
ColorGreen: number;
|
|
30
|
+
ColorBlue: number;
|
|
31
|
+
Origine: number;
|
|
32
|
+
LienTrack: string | null;
|
|
33
|
+
}
|
|
34
|
+
interface User {
|
|
35
|
+
firstname: string;
|
|
36
|
+
lastname: string;
|
|
37
|
+
program?: string;
|
|
38
|
+
token: string;
|
|
39
|
+
}
|
|
40
|
+
interface Instance {
|
|
41
|
+
id: string;
|
|
42
|
+
name: string;
|
|
43
|
+
}
|
|
44
|
+
interface Profile {
|
|
45
|
+
firstname: string;
|
|
46
|
+
lastname: string;
|
|
47
|
+
email: string;
|
|
48
|
+
username: string;
|
|
49
|
+
cn: string;
|
|
50
|
+
city: string;
|
|
51
|
+
country: string;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
declare const CD_INSTANCES: Array<Instance>;
|
|
55
|
+
declare const IGENSIA_INSTANCES: Array<Instance>;
|
|
56
|
+
declare const INSTANCES: Array<Instance>;
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* Authenticates a user with the CAS server using their username and password.
|
|
60
|
+
* Performs the standard CAS multi-step authentication redirection flow in the background,
|
|
61
|
+
* parsing and saving the session cookies.
|
|
62
|
+
*
|
|
63
|
+
* @param instanceId The unique identifier of the school instance.
|
|
64
|
+
* @param username The student's login identifier.
|
|
65
|
+
* @param password The student's raw password.
|
|
66
|
+
* @returns A promise resolving to the authenticated User object, containing the session token.
|
|
67
|
+
*/
|
|
68
|
+
declare function loginWithCredentials(instanceId: string, username: string, password: string): Promise<User>;
|
|
69
|
+
/**
|
|
70
|
+
* Fetches the student's timetable lessons from the schedule server.
|
|
71
|
+
* Requires a valid serialized cookie jar token from `loginWithCredentials`.
|
|
72
|
+
*
|
|
73
|
+
* @param instanceId The unique identifier of the school instance.
|
|
74
|
+
* @param token The serialized cookie jar session token.
|
|
75
|
+
* @returns A promise resolving to an array of parsed Lesson objects.
|
|
76
|
+
*/
|
|
77
|
+
declare function getPlanning(instanceId: string, token: string): Promise<Array<Lesson>>;
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* Fetches the student's profile information from the CAS server.
|
|
81
|
+
* Requires a valid serialized cookie jar token from `loginWithCredentials`.
|
|
82
|
+
*
|
|
83
|
+
* @param instanceId The unique identifier of the school instance.
|
|
84
|
+
* @param token The serialized cookie jar session token.
|
|
85
|
+
* @returns A promise resolving to the student's Profile object.
|
|
86
|
+
* @throws An Error if the token is invalid or expired, or if the profile cannot be parsed.
|
|
87
|
+
*/
|
|
88
|
+
declare function getProfile(instanceId: string, token: string): Promise<Profile>;
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* Retrieves the CAS authentication server URL for a given instance.
|
|
92
|
+
*
|
|
93
|
+
* **Important Note:**
|
|
94
|
+
* This function is maintained to ensure public API consistency across various services.
|
|
95
|
+
* It also future-proofs the library in case IGENSIA and C&D groups decide to
|
|
96
|
+
* split their CAS servers in the future, as they did for their apps.
|
|
97
|
+
*
|
|
98
|
+
* **Example:**
|
|
99
|
+
* ```typescript
|
|
100
|
+
* import { getCASURL } from "linkgor";
|
|
101
|
+
*
|
|
102
|
+
* const casUrl = getCASURL("epsi");
|
|
103
|
+
* // => "https://cas-p.wigorservices.net/cas/login"
|
|
104
|
+
* ```
|
|
105
|
+
*
|
|
106
|
+
* @param _instanceId The unique identifier of the instance (currently unused as all schools share the same CAS endpoint).
|
|
107
|
+
* @returns The CAS login portal URL.
|
|
108
|
+
*/
|
|
109
|
+
declare const getCASURL: (_instanceId: string) => string;
|
|
110
|
+
|
|
111
|
+
export { CD_INSTANCES, IGENSIA_INSTANCES, INSTANCES, type Instance, type Lesson, type Profile, type User, getCASURL, getPlanning, getProfile, loginWithCredentials };
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
interface Lesson {
|
|
2
|
+
Commentaire: string | null;
|
|
3
|
+
NoCours: number;
|
|
4
|
+
NoGroupe: number;
|
|
5
|
+
LibelleGroupe: string | null;
|
|
6
|
+
LibelleSemaine: string | null;
|
|
7
|
+
Matiere: string | null;
|
|
8
|
+
Salles: string | null;
|
|
9
|
+
NomEcole: string | null;
|
|
10
|
+
LogoEcole: string | null;
|
|
11
|
+
CoursMixtePicto: string | null;
|
|
12
|
+
CoursMixteInfoBulle: string | null;
|
|
13
|
+
FondCour: string | null;
|
|
14
|
+
NomProf: string | null;
|
|
15
|
+
Duree: number | null;
|
|
16
|
+
RecurrenceRule: string | null;
|
|
17
|
+
RecurrenceID: string | null;
|
|
18
|
+
RecurrenceException: string | null;
|
|
19
|
+
IsAllDay: boolean;
|
|
20
|
+
Title: string | null;
|
|
21
|
+
Description: string | null;
|
|
22
|
+
Start: string;
|
|
23
|
+
StartTimezone: string | null;
|
|
24
|
+
End: string;
|
|
25
|
+
EndTimezone: string | null;
|
|
26
|
+
TeamsURL: string | null;
|
|
27
|
+
TeamsUrl: string | null;
|
|
28
|
+
ColorRed: number;
|
|
29
|
+
ColorGreen: number;
|
|
30
|
+
ColorBlue: number;
|
|
31
|
+
Origine: number;
|
|
32
|
+
LienTrack: string | null;
|
|
33
|
+
}
|
|
34
|
+
interface User {
|
|
35
|
+
firstname: string;
|
|
36
|
+
lastname: string;
|
|
37
|
+
program?: string;
|
|
38
|
+
token: string;
|
|
39
|
+
}
|
|
40
|
+
interface Instance {
|
|
41
|
+
id: string;
|
|
42
|
+
name: string;
|
|
43
|
+
}
|
|
44
|
+
interface Profile {
|
|
45
|
+
firstname: string;
|
|
46
|
+
lastname: string;
|
|
47
|
+
email: string;
|
|
48
|
+
username: string;
|
|
49
|
+
cn: string;
|
|
50
|
+
city: string;
|
|
51
|
+
country: string;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
declare const CD_INSTANCES: Array<Instance>;
|
|
55
|
+
declare const IGENSIA_INSTANCES: Array<Instance>;
|
|
56
|
+
declare const INSTANCES: Array<Instance>;
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* Authenticates a user with the CAS server using their username and password.
|
|
60
|
+
* Performs the standard CAS multi-step authentication redirection flow in the background,
|
|
61
|
+
* parsing and saving the session cookies.
|
|
62
|
+
*
|
|
63
|
+
* @param instanceId The unique identifier of the school instance.
|
|
64
|
+
* @param username The student's login identifier.
|
|
65
|
+
* @param password The student's raw password.
|
|
66
|
+
* @returns A promise resolving to the authenticated User object, containing the session token.
|
|
67
|
+
*/
|
|
68
|
+
declare function loginWithCredentials(instanceId: string, username: string, password: string): Promise<User>;
|
|
69
|
+
/**
|
|
70
|
+
* Fetches the student's timetable lessons from the schedule server.
|
|
71
|
+
* Requires a valid serialized cookie jar token from `loginWithCredentials`.
|
|
72
|
+
*
|
|
73
|
+
* @param instanceId The unique identifier of the school instance.
|
|
74
|
+
* @param token The serialized cookie jar session token.
|
|
75
|
+
* @returns A promise resolving to an array of parsed Lesson objects.
|
|
76
|
+
*/
|
|
77
|
+
declare function getPlanning(instanceId: string, token: string): Promise<Array<Lesson>>;
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* Fetches the student's profile information from the CAS server.
|
|
81
|
+
* Requires a valid serialized cookie jar token from `loginWithCredentials`.
|
|
82
|
+
*
|
|
83
|
+
* @param instanceId The unique identifier of the school instance.
|
|
84
|
+
* @param token The serialized cookie jar session token.
|
|
85
|
+
* @returns A promise resolving to the student's Profile object.
|
|
86
|
+
* @throws An Error if the token is invalid or expired, or if the profile cannot be parsed.
|
|
87
|
+
*/
|
|
88
|
+
declare function getProfile(instanceId: string, token: string): Promise<Profile>;
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* Retrieves the CAS authentication server URL for a given instance.
|
|
92
|
+
*
|
|
93
|
+
* **Important Note:**
|
|
94
|
+
* This function is maintained to ensure public API consistency across various services.
|
|
95
|
+
* It also future-proofs the library in case IGENSIA and C&D groups decide to
|
|
96
|
+
* split their CAS servers in the future, as they did for their apps.
|
|
97
|
+
*
|
|
98
|
+
* **Example:**
|
|
99
|
+
* ```typescript
|
|
100
|
+
* import { getCASURL } from "linkgor";
|
|
101
|
+
*
|
|
102
|
+
* const casUrl = getCASURL("epsi");
|
|
103
|
+
* // => "https://cas-p.wigorservices.net/cas/login"
|
|
104
|
+
* ```
|
|
105
|
+
*
|
|
106
|
+
* @param _instanceId The unique identifier of the instance (currently unused as all schools share the same CAS endpoint).
|
|
107
|
+
* @returns The CAS login portal URL.
|
|
108
|
+
*/
|
|
109
|
+
declare const getCASURL: (_instanceId: string) => string;
|
|
110
|
+
|
|
111
|
+
export { CD_INSTANCES, IGENSIA_INSTANCES, INSTANCES, type Instance, type Lesson, type Profile, type User, getCASURL, getPlanning, getProfile, loginWithCredentials };
|