forked from a2br/ecoledirecte-api-types
/
textbook.ts
91 lines (80 loc) · 1.74 KB
/
textbook.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
import { failureRes } from "..";
//? WITH DATE
export type textbookDateRes = textbookDateResSuccess | failureRes;
export type textbookDateResSuccess = {
code: 200;
token: string;
host: string;
data: textbookDateResData;
};
export type textbookDateResData = {
date: string;
matieres: Array<textbookDateAssignement>;
};
export type textbookDateAssignement = {
entityCode: string;
entityLibelle: string;
entityType: string;
matiere: string;
codeMatiere: string;
nomProf: string;
id: number;
interrogation: boolean;
blogActif: boolean;
nbJourMaxRenduDevoir: number;
aFaire?: {
idDevoir: number;
/** BASE64 */
contenu: string;
rendreEnLigne: boolean;
donneLe: string;
effectue: boolean;
ressource: string;
ressourceDocuments: unknown[];
documents: unknown[];
elementsProg: unknown[];
liensManuel: unknown[];
documentsRendus: unknown[];
/** The last one */
contenuDeSeance: {
/** BASE64 */
contenu: string;
documents: unknown[];
};
};
/** The one of the day */
contenuDeSeance?: {
idDevoir: number;
/** BASE64 */
contenu: string;
documents: Array<unknown>;
elementsProg: Array<unknown>;
liensManuel: Array<unknown>;
};
};
//? WITHOUT DATE
export type textbookRes = textbookResSuccess | failureRes;
export type textbookResSuccess = {
code: 200;
token: string;
host: string;
/**
* UNPREDICTABLE KEYS
* @example data["2020-01-14"]: Array<textbookAssignement>
*/
data: textbookResData;
};
export type textbookResData = {
[key: string]: Array<textbookAssignement>;
}
export type textbookAssignement = {
matiere: string;
codeMatiere: string;
aFaire: boolean;
idDevoir: number;
documentsAFaire: boolean;
donneLe: string;
effectue: boolean;
interrogation: boolean;
rendreEnLigne: boolean;
};