RestUrlManager
Creates a manager that allows manual provide of Rest URL's instead of automatic with JWT register. Useful if you save the certificate for longer period of times if you don't want to spam VULCAN with new certs.
Example code:
const { VulcanJwtRegister, Keypair, VulcanHebeCe, RestUrlManager } = require('hebece');
const apiap = '<html><body><input id='ap' type='hidden' value='{"Success":true,"Tokens":["Some.Jwt.Here", "Another.Jwt.here"],"Alias":"example@example.com","Email":"example@example.com","EmailCandidate":null,"GivenName":"Jacek","Surname":"Różycki","IsConsentAccepted":true,"CanAcceptConsent":true,"AccessToken":"1yearapiaptoken","ErrorMessage":null,"Capabilities":["EMAIL_CONFIRMATION"]}' /></body></html>'
(async () => {
const keypair = await (new Keypair()).init();
const jwt = await (new VulcanJwtRegister(keypair, apiap)).init();
const restMgr = new RestUrlManager();
await restMgr.setRestUrls(
[
"https://lekcjaplus.vulcan.net.pl/powiatwulkanowy"
]
);
const hebe = new VulcanHebeCe(keypair);
await hebe.connect();
const students = await hebe.listStudents(); // Get every student
await hebe.selectStudent(); // selects first student or needs PupilId to select proper student
// Now you can call functions like getLuckyNumber()
})()Last updated