webuntis-client 1.0.0 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +44 -1
- package/dist/clients/Http.js +2 -2
- package/package.json +5 -10
package/README.md
CHANGED
|
@@ -2,4 +2,47 @@
|
|
|
2
2
|
|
|
3
3
|
A Web Untis API Client to interact with [Web Untis](https://webuntis.com).
|
|
4
4
|
|
|
5
|
-
>
|
|
5
|
+
> Work In Progress \
|
|
6
|
+
> Not complete
|
|
7
|
+
|
|
8
|
+
## Examples
|
|
9
|
+
|
|
10
|
+
### Login
|
|
11
|
+
|
|
12
|
+
```typescript
|
|
13
|
+
const credentials = new Credentials(
|
|
14
|
+
"WebUntisClient",
|
|
15
|
+
"school-name",
|
|
16
|
+
"username",
|
|
17
|
+
"password",
|
|
18
|
+
);
|
|
19
|
+
|
|
20
|
+
const client = new WebUntisClient(credentials);
|
|
21
|
+
|
|
22
|
+
await client.login();
|
|
23
|
+
|
|
24
|
+
// Get what you need
|
|
25
|
+
|
|
26
|
+
await client.logout();
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
### Timetable
|
|
30
|
+
|
|
31
|
+
```typescript
|
|
32
|
+
const start = new Date("2026");
|
|
33
|
+
const end = new Date("2027");
|
|
34
|
+
|
|
35
|
+
await client.getOwnTimetable(start, end);
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
### App data
|
|
39
|
+
|
|
40
|
+
```typescript
|
|
41
|
+
await client.getAppData();
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
### Profile data
|
|
45
|
+
|
|
46
|
+
```typescript
|
|
47
|
+
await client.getProfile();
|
|
48
|
+
```
|
package/dist/clients/Http.js
CHANGED
|
@@ -64,8 +64,8 @@ export class HttpClient {
|
|
|
64
64
|
}
|
|
65
65
|
const contentType = response.headers.get('content-type');
|
|
66
66
|
if (contentType?.includes('application/json')) {
|
|
67
|
-
return response.json();
|
|
67
|
+
return await response.json();
|
|
68
68
|
}
|
|
69
|
-
return response.text();
|
|
69
|
+
return await response.text();
|
|
70
70
|
}
|
|
71
71
|
}
|
package/package.json
CHANGED
|
@@ -1,35 +1,31 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "webuntis-client",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2",
|
|
4
4
|
"description": "A Web Untis API Client",
|
|
5
|
-
|
|
6
5
|
"main": "dist/index.js",
|
|
7
6
|
"module": "dist/index.js",
|
|
8
7
|
"typings": "dist/index.d.ts",
|
|
9
|
-
|
|
10
8
|
"scripts": {
|
|
11
|
-
"build": "tsc"
|
|
9
|
+
"build": "tsc",
|
|
10
|
+
"release:patch": "npm version patch && bun run build && npm publish",
|
|
11
|
+
"release:minor": "npm version minor && bun run build && npm publish",
|
|
12
|
+
"release:major": "npm version major && bun run build && npm publish"
|
|
12
13
|
},
|
|
13
|
-
|
|
14
14
|
"repository": {
|
|
15
15
|
"type": "git",
|
|
16
16
|
"url": "https://github.com/Dev-LeChacal/WebUntisClient.git"
|
|
17
17
|
},
|
|
18
|
-
|
|
19
18
|
"keywords": [
|
|
20
19
|
"webuntis",
|
|
21
20
|
"api",
|
|
22
21
|
"client"
|
|
23
22
|
],
|
|
24
|
-
|
|
25
23
|
"author": "Dev-LeChacal",
|
|
26
24
|
"license": "MIT",
|
|
27
25
|
"private": false,
|
|
28
|
-
|
|
29
26
|
"files": [
|
|
30
27
|
"dist"
|
|
31
28
|
],
|
|
32
|
-
|
|
33
29
|
"devDependencies": {
|
|
34
30
|
"@eslint/js": "^9.39.2",
|
|
35
31
|
"@types/bun": "^1.3.8",
|
|
@@ -40,7 +36,6 @@
|
|
|
40
36
|
"typescript": "^5.9.3",
|
|
41
37
|
"typescript-eslint": "^8.54.0"
|
|
42
38
|
},
|
|
43
|
-
|
|
44
39
|
"dependencies": {
|
|
45
40
|
"dotenv": "^17.2.3",
|
|
46
41
|
"eslint-plugin-simple-import-sort": "^12.1.1",
|