diff --git a/package.json b/package.json index af05544..b458aff 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ecoledirecte-api-types", - "version": "0.14.0", + "version": "0.14.1", "description": "", "main": "default/index.js", "repository": { diff --git a/v3/responses/login/index.ts b/v3/responses/login/index.ts index 9eca419..1712e2c 100644 --- a/v3/responses/login/index.ts +++ b/v3/responses/login/index.ts @@ -3,7 +3,35 @@ import { account } from "./accounts"; export * from "./accounts"; -export type loginRes = loginResSuccess | failureRes; +export type base64 = string +export type loginRes = loginResSuccess | failureRes | A2FRes + +export type A2FRes = { + code: 250, + token: string, + message: 'Identifiant et/ou mot de passe invalide !', + data: { changementMDP: false, accounts: [] } +} + +export type A2FQCM = { + code: 200, + data: { + question: base64, + propositions: Array + }, + message: null, // ??? + host: "HTTP" +} + +export type A2FQCMRes = { + code: 200, + data: { + cn: base64, + cv: base64, + }, + message: null, // ??? + host: "HTTP" +} export type loginResSuccess = { code: 200; diff --git a/v3/routes.ts b/v3/routes.ts index 44a977b..2521452 100644 --- a/v3/routes.ts +++ b/v3/routes.ts @@ -22,25 +22,42 @@ export const Routes = { return "/v3/login.awp"; }, + /** + * Route for: + * - POST /v3/connexion/doubleauth.awp?verbe=get&v=4.56.0 + */ + getA2FQCM(): string { + return "/v3/connexion/doubleauth.awp?verbe=get&v=4.56.0" + }, + + /** + * Route for: + * - POST v3/connexion/doubleauth.awp?verbe=post&v=4.56.0 + */ + postA2FRes(): string { + return "/v3/connexion/doubleauth.awp?verbe=post&v=4.56.0" + }, + + //! TEACHER /** * Use with `root2`! * * Route for: - * - POST *p/v3/niveauxListe.awp?verbe=get&v=4.14.7 + * - POST *p/v3/niveauxListe.awp?verbe=get&v=4.56.0 */ teacherSchools(): string { - return "/v3/niveauxListe.awp?verbe=get&v=4.14.7"; + return "/v3/niveauxListe.awp?verbe=get&v=4.56.0"; }, /** * Use with `root2`! * * Route for: - * - POST *p/v3/classes/{classId}/eleves.awp?verbe=get&v=4.14.7 + * - POST *p/v3/classes/{classId}/eleves.awp?verbe=get&v=4.56.0 */ teacherStudents(classId: number): string { - return `/v3/classes/${classId}/eleves.awp?verbe=get&v=4.14.7`; + return `/v3/classes/${classId}/eleves.awp?verbe=get&v=4.56.0`; }, //! STUDENT @@ -209,7 +226,7 @@ export const Routes = { * - POST /v3/comptes/detail.awp */ studentWallets(): string { - return "/v3/comptes/detail.awp?verbe=get&v=4.14.3"; + return "/v3/comptes/detail.awp?verbe=get&v=4.56.0"; }, /**