Skip to content

Commit 3ba63d6

Browse files
committed
fix: imports and examples
1 parent 9dbdbc3 commit 3ba63d6

File tree

20 files changed

+38
-130
lines changed

20 files changed

+38
-130
lines changed

examples/.env.example

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
BIOME_USERNAME=""
2-
BIOME_PASSWORD=""
1+
USERNAME=""
2+
PASSWORD=""

examples/_credentials.ts

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,10 @@
11
import { config } from "dotenv";
22
import { join } from "node:path";
3+
34
// Load the `.env` file configuration.
45
config({ path: join(__dirname, ".env") });
56

6-
if (!process.env.BIOME_USERNAME || !process.env.BIOME_PASSWORD) {
7-
throw new Error("You need to provide credentials in the `.env` file.");
8-
}
9-
107
export const credentials = {
11-
password: process.env.BIOME_PASSWORD,
12-
username: process.env.BIOME_USERNAME
8+
password: process.env.PASSWORD!,
9+
username: process.env.USERNAME!
1310
};

examples/biome/profile.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
import * as biome from "~/biome";
2-
import * as cas from "~/cas";
3-
1+
import { cas, biome } from "unilim";
42
import { credentials } from "../_credentials";
53

64
void async function main () {

examples/cas/login.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
import * as cas from "~/cas";
2-
1+
import { cas } from "unilim";
32
import { credentials } from "../_credentials";
43

54
void async function main () {

examples/cas/service.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
import * as cas from "~/cas";
2-
1+
import { cas } from "unilim";
32
import { credentials } from "../_credentials";
43

54
void async function main () {
65
// 1. we authenticate to the CAS.
76
const cookie = await cas.login(credentials.username, credentials.password);
7+
88
// 2. we generate a ticket URL for an external service.
99
const ticket = await cas.service(cookie, cas.EXTERNAL_SERVICES.COMMUNITIES_MOODLE);
1010

examples/events_calendar_id.ts

Lines changed: 0 additions & 19 deletions
This file was deleted.

examples/external_service_ticket.ts

Lines changed: 0 additions & 18 deletions
This file was deleted.

examples/iut/info/edt/main.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1-
import { getTimetableFromBuffer } from "~iut/info/edt";
1+
import { iut } from "unilim";
2+
23
import fs from "node:fs/promises";
34
import path from "node:path";
45

56
void async function main () {
67
const buffer = await fs.readFile(path.join(__dirname, "example.pdf"));
7-
const timetable = await getTimetableFromBuffer(buffer);
8+
const timetable = await iut.info.timetable.getTimetableFromBuffer(buffer);
89

910
console.dir(timetable, { depth: Infinity });
1011
}();

examples/iut/signatures/extract.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
1-
import * as cas from "~/cas";
2-
import * as signatures from "~/iut/signatures";
1+
import { iut, cas } from "unilim";
32

43
import { credentials } from "../../_credentials";
54

65
void async function main () {
7-
const state = await signatures.createAuthorizeClientState();
6+
const state = await iut.signatures.createAuthorizeClientState();
87

98
// we authenticate to the CAS.
109
const cookie = await cas.login(credentials.username, credentials.password);

examples/moodle.ts

Lines changed: 0 additions & 13 deletions
This file was deleted.

0 commit comments

Comments
 (0)