No description
- HTML 80.8%
- Rust 16.9%
- JavaScript 2.3%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
| .cargo | ||
| examples | ||
| scripts | ||
| src | ||
| tests | ||
| .gitignore | ||
| Cargo.lock | ||
| Cargo.toml | ||
| LICENSE.md | ||
| README.md | ||
@unilim/signatures
IUT signatures (transcript / relevé de notes) bindings for Unilim, compiled from Rust to WebAssembly.
Install
npm install @unilim/signatures @unilim/cas
A Signatures session is opened from a CAS session: @unilim/signatures receives
a CAS object from @unilim/cas
across the JS boundary, so install both.
Usage
import { CAS } from "@unilim/cas";
import { Signatures } from "@unilim/signatures";
const cas = await CAS.restore(username, password, connection, key);
const signatures = await Signatures.fromCAS(cas);
const reportCard = await signatures.dump();
console.log(reportCard);
// or parse an HTML page you already have:
const parsed = Signatures.parse(html);
How the CAS object is shared
Signatures.fromCAS(cas) takes the live CAS object, not a cookie string. This
crate depends on unilim-cas and sources the CAS type from it:
- wasm —
unilim_cas::boundary(extern declarations of@unilim/cas'sCAS/OAuth2); signatures calls the object'sauthorize/cookiemethods across the JS boundary and links no CAS client. - native —
unilim_cas::client::Cas(the real Rust client);from_castakes a&Casand calls its methods directly.