finki-auth 1.2.2 → 1.4.0

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.
Files changed (2) hide show
  1. package/README.md +25 -6
  2. package/package.json +6 -6
package/README.md CHANGED
@@ -1,15 +1,34 @@
1
1
  # FINKI Auth
2
2
 
3
- This is an NPM package for managing authentication and sessions for FCSE CAS and the other services. Currently supported:
3
+ NPM (Node) package for managing authentication and sessions for FCSE CAS and the other services. Uses an HTTP client under the hood, and not a full browser (such as Puppeteer).
4
4
 
5
- - CAS
6
- - Courses
7
- - Diplomas
5
+ ## Features
6
+
7
+ Currently supports the following services:
8
+
9
+ - [CAS](https://cas.finki.ukim.mk/)
10
+ - [Courses](https://courses.finki.ukim.mk/)
11
+ - [Diplomas](https://diplomski.finki.ukim.mk/)
8
12
 
9
13
  ## Installation
10
14
 
11
- `npm i finki-auth`
15
+ You can add the package to your NPM project by running `npm i finki-auth`.
16
+
17
+ ## Example
18
+
19
+ ```ts
20
+ import { CasAuthentication, Service } from "finki-auth";
21
+
22
+ const auth = new CasAuthentication(credentials.username, credentials.password);
23
+ const rawCookies = await auth.authenticate(Service.COURSES);
24
+
25
+ const cookies: Record<string, string> = {};
26
+
27
+ for (const { key, value } of rawCookies) {
28
+ cookies[key] = value;
29
+ }
30
+ ```
12
31
 
13
32
  ## License
14
33
 
15
- This project is licensed under the MIT license.
34
+ This project is licensed under the terms of the MIT license.
package/package.json CHANGED
@@ -17,12 +17,12 @@
17
17
  "axios-cookiejar-support": "^6.0.0",
18
18
  "jsdom": "^26.0.0",
19
19
  "tough-cookie": "^5.1.2",
20
- "zod": "^3.24.2"
20
+ "zod": "^3.25.31"
21
21
  },
22
22
  "description": "Authentication for FCSE services",
23
23
  "devDependencies": {
24
24
  "@commitlint/cli": "^19.8.0",
25
- "@commitlint/config-conventional": "^19.8.0",
25
+ "@commitlint/config-conventional": "^19.8.1",
26
26
  "@semantic-release/changelog": "^6.0.3",
27
27
  "@semantic-release/git": "^10.0.1",
28
28
  "@types/jsdom": "^21.1.7",
@@ -39,7 +39,7 @@
39
39
  "vitest": "^3.1.1"
40
40
  },
41
41
  "engines": {
42
- "node": "^20 || ^22"
42
+ "node": "^20 || ^22 || ^24"
43
43
  },
44
44
  "files": [
45
45
  "dist",
@@ -67,11 +67,11 @@
67
67
  "lint": "eslint . --ignore-pattern \"**/test/*\" --no-warn-ignored --cache",
68
68
  "prepare": "husky",
69
69
  "package": "npm run build && npm pack",
70
- "release": "semantic-release",
71
- "release:dry": "npm run release -- --dry-run",
70
+ "release": "npm run build && semantic-release",
71
+ "release:dry": "npm run build && npm run release -- --dry-run",
72
72
  "test": "vitest run --exclude dist"
73
73
  },
74
74
  "type": "module",
75
75
  "types": "dist/index.d.ts",
76
- "version": "1.2.2"
76
+ "version": "1.4.0"
77
77
  }