Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ecoledirecte-api-types",
"version": "0.14.0",
"version": "0.14.1",
"description": "",
"main": "default/index.js",
"repository": {
Expand Down
30 changes: 29 additions & 1 deletion v3/responses/login/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<base64>
},
message: null, // ???
host: "HTTP<n° serveur>"
}

export type A2FQCMRes = {
code: 200,
data: {
cn: base64,
cv: base64,
},
message: null, // ???
host: "HTTP<n° serveur>"
}

export type loginResSuccess = {
code: 200;
Expand Down
27 changes: 22 additions & 5 deletions v3/routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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";
},

/**
Expand Down