ecoledirecte.js
Version:
Good-looking client for EcoleDirecte's private API.
22 lines (21 loc) • 670 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.Document = void 0;
const util_1 = require("../util");
class Document {
constructor(o, account, archiveYear) {
this.account = account;
this.archiveYear = archiveYear;
this.date = new Date(o.date);
this.id = o.id;
this.studentId = o.idEleve;
this.name = o.libelle;
this.type = o.type || undefined;
this._raw = o;
}
async download() {
const doc = await (0, util_1.downloadDocument)(this.account.token, this.id, this.type || "", this.archiveYear);
return doc;
}
}
exports.Document = Document;