1.0.0 • Published 9 months ago

ecoledirecte.js v1.0.0

Weekly downloads
1
License
MIT
Repository
github
Last release
9 months ago

ecoledirecte.js · GitHub npm npm

As of August 8, 2023, this module is no longer maintained: This means that although the module is perfectly functioning, I will not update it to comply to future EcoleDirecte API changes. The module may fail to fetch or send data. I would greatly appreciate PRs for feature requests / bug patches, as I no longer have the time to work on this project. Thank you.

Browse EcoleDirecte's private API with ED.js, an unofficial API client.

ed.js is a Promise-based module, built on TypeScript for a better IntelliSense and type-guarded features.

Examples

Warning: these examples might not work on your machine (depending on whether you're using commonjs or ES6 module)

Get the homework of a day

import { Session } from "ecoledirecte.js";

// Create a new Session.
const session = new Session("identifiant", "motdepasse");

// Bring your session to life!
const account = await session.login().catch(err => {
	console.error("This login did not go well.");
});

// Is it a student account?
if (!account || account.type !== "student") throw new Error("Not a student!");

// Get the homework due for a specific date as a simplified array
const homework = await account.getHomework({ dates: "2021-01-14" });

// Every piece of data from the API is reformatted  (eg: base64 string are
// converted to text/HTML). The raw data remains always available as _raw
console.log(homework[2].contenuDeSeance.content.text);

Introduction to events

Events can be used to do something when something else happens, in real-time. (very specific, as you can tell) For instance, the following will log the method and the url each time ed.js sends a request to the EcoleDirecte servers.

import { events } from "ecoledirecte.js";

events.on("request", ({ method, url }) => console.log(method, url));
// POST https://api.ecoledirecte.com/v3/login.awp
// POST https://api.ecoledirecte.com/v3/eleves/4179/timeline.awp
// ...

Dependencies walkthrough

DependencyDescription
node-fetchA light-weight module that brings window.fetch to Node.js
html-to-textConverter that parses HTML and returns text.
ecoledirecte-api-typesModule that maps the routes and types related to EcoleDirecte's API. Originally a part of ed.js
1.0.0

9 months ago

0.33.1

1 year ago

0.32.0

2 years ago

0.33.0

1 year ago

0.31.1

2 years ago

0.31.0

2 years ago

0.30.0

2 years ago

0.29.0

3 years ago

0.29.1

3 years ago

0.28.1

3 years ago

0.28.0

3 years ago

0.27.0

3 years ago

0.25.0

3 years ago

0.26.0

3 years ago

0.23.1

3 years ago

0.23.0

3 years ago

0.24.0

3 years ago

0.22.0

3 years ago

0.21.0

3 years ago

0.20.1

3 years ago

0.20.0

3 years ago

0.19.1

3 years ago

0.19.0

3 years ago

0.18.2

3 years ago

0.18.1

3 years ago

0.18.0

3 years ago

0.17.0

3 years ago

0.16.0

3 years ago

0.15.0

3 years ago

0.14.1

3 years ago

0.14.0

3 years ago

0.13.0

3 years ago

0.12.1

3 years ago

0.12.2

3 years ago

0.12.3

3 years ago

0.12.0

3 years ago

0.11.4

3 years ago

0.11.3

3 years ago

0.11.2

3 years ago

0.11.1

3 years ago

0.11.0

3 years ago

0.10.0

3 years ago

0.9.2

3 years ago

0.9.1

3 years ago

0.9.0

3 years ago

0.9.0-1

3 years ago

0.9.0-0

3 years ago

0.9.0-2

3 years ago

0.8.0

3 years ago

0.7.2

3 years ago

0.7.3

3 years ago

0.7.1

3 years ago

0.7.0

3 years ago

0.6.1

3 years ago

0.6.0

3 years ago

0.5.0

3 years ago

0.1.0

3 years ago

0.3.0

3 years ago

0.2.1

3 years ago

0.2.0

3 years ago

0.4.1

3 years ago

0.3.2

3 years ago

0.4.0

3 years ago

0.3.1

3 years ago

0.4.2

3 years ago

0.0.3

3 years ago

0.0.2

3 years ago

0.0.1

3 years ago