UNPKG

ecoledirecte.js

Version:

Good-looking client for EcoleDirecte's private API.

26 lines (25 loc) 915 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.getCommonTimeline = exports.getTimeline = void 0; const v3_1 = require("ecoledirecte-api-types/v3"); const util_1 = require("../util"); async function getTimeline(id, token, context = {}) { const body = await (0, util_1.makeRequest)({ method: "POST", path: v3_1.Routes.studentTimeline(id), body: { token }, guard: true, }, { userId: id, action: "getTimeline", ...context }); return body; } exports.getTimeline = getTimeline; async function getCommonTimeline(id, token, context = {}) { const body = await (0, util_1.makeRequest)({ method: "POST", path: v3_1.Routes.commonTimeline("E", id), body: { token }, guard: true, }, { userId: id, action: "getCommonTimeline", ...context }); return body; } exports.getCommonTimeline = getCommonTimeline;