-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.ts
43 lines (35 loc) · 1.3 KB
/
index.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
import { LoginData } from "./types/LoginData"
import { FerrumUser } from "./models/User"
import { configDotenv } from "dotenv"
configDotenv()
const newUser: LoginData = {
user: process.env.FERRUM_USER,
password: process.env.FERRUM_PASS
}
async function fetchUserInfo() {
try {
// Inicializamos
const ferrumUser = new FerrumUser(newUser);
await ferrumUser.InitPage();
// Obtenemos información de Usuario.
console.log(ferrumUser.userInfo)
// Obtenemos las tareas parametrizadas a nuestras necesidades.
console.log("Tareas")
//const allTasksPending = await ferrumUser.getInfo("Task", "Pending")
//const allTasksSend = await ferrumUser.getInfo("Task", "Send")
const allTasks = await ferrumUser.getInfo("Task", "All")
console.log(allTasks)
console.log("Auto Evaluaciones")
const allSelfEvaluation = await ferrumUser.getInfo("Self Evaluation", "Pending")
console.log(allSelfEvaluation)
// Obtenemos el estado de alguna tarea.
const task = await ferrumUser.getHomeworkInfo("1415023")
console.log(task)
// Cerramos Sesión.
await ferrumUser.closeSession()
return
} catch (error) {
console.error("Error in FerrumJS", error);
}
}
fetchUserInfo()