auth-events 0.0.5 → 0.0.8
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 +9 -1
- package/dist/index.d.ts +6 -1
- package/package.json +39 -39
package/README.md
CHANGED
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
# auth-events
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
<<<<<<< HEAD
|
|
4
|
+

|
|
5
|
+
=======
|
|
6
|
+

|
|
4
7
|
|
|
5
8
|
|
|
9
|
+
>>>>>>> 3ded054 (feat: add emitLogin helper with full AuthEvent payload)
|
|
6
10
|
|
|
7
11
|
# auth-events — Authentication Event Engine for Node.js
|
|
8
12
|
|
|
@@ -165,3 +169,7 @@ Open an issue or submit a pull request 🚀
|
|
|
165
169
|
## 📄 License
|
|
166
170
|
|
|
167
171
|
MIT License
|
|
172
|
+
<<<<<<< HEAD
|
|
173
|
+
|
|
174
|
+
=======
|
|
175
|
+
>>>>>>> 733ea20 (chore: prepare release)
|
package/dist/index.d.ts
CHANGED
|
@@ -1,10 +1,15 @@
|
|
|
1
|
-
type AuthEventType = "login" | "logout" | "password_changed" | "role_changed";
|
|
1
|
+
type AuthEventType = "login" | "logout" | "register" | "password_changed" | "role_changed" | "session_revoked" | "suspicious_login" | "token_expired";
|
|
2
2
|
interface AuthEvent {
|
|
3
3
|
type: AuthEventType;
|
|
4
4
|
userId: string;
|
|
5
5
|
sessionId?: string;
|
|
6
6
|
ip?: string;
|
|
7
7
|
userAgent?: string;
|
|
8
|
+
provider?: "google" | "firebase" | "auth0" | "custom";
|
|
9
|
+
email?: string;
|
|
10
|
+
roles?: string[];
|
|
11
|
+
status?: "success" | "failed";
|
|
12
|
+
metadata?: Record<string, any>;
|
|
8
13
|
timestamp: Date;
|
|
9
14
|
}
|
|
10
15
|
type AuthEventHandler = (event: AuthEvent, context: unknown) => void | Promise<void>;
|
package/package.json
CHANGED
|
@@ -1,39 +1,39 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "auth-events",
|
|
3
|
-
"version": "0.0.
|
|
4
|
-
"description": "A lightweight Node.js library to track and react to authentication events across any auth provider.",
|
|
5
|
-
"type": "module",
|
|
6
|
-
"license": "MIT",
|
|
7
|
-
"main": "dist/index.js",
|
|
8
|
-
"types": "dist/index.d.ts",
|
|
9
|
-
"exports": {
|
|
10
|
-
".": {
|
|
11
|
-
"import": "./dist/index.js",
|
|
12
|
-
"types": "./dist/index.d.ts"
|
|
13
|
-
}
|
|
14
|
-
},
|
|
15
|
-
"files": [
|
|
16
|
-
"dist/index.js",
|
|
17
|
-
"dist/index.d.ts"
|
|
18
|
-
],
|
|
19
|
-
"author": "Meraj Ansari",
|
|
20
|
-
"keywords": [
|
|
21
|
-
"auth",
|
|
22
|
-
"authentication",
|
|
23
|
-
"sessions",
|
|
24
|
-
"events",
|
|
25
|
-
"nodejs",
|
|
26
|
-
"npm"
|
|
27
|
-
],
|
|
28
|
-
"scripts": {
|
|
29
|
-
"build": "tsup src/index.ts --format esm --dts",
|
|
30
|
-
"dev": "tsup src/index.ts --watch",
|
|
31
|
-
"prepublishOnly": "npm run build"
|
|
32
|
-
},
|
|
33
|
-
"devDependencies": {
|
|
34
|
-
"tsup": "^6.6.0",
|
|
35
|
-
"typescript": "^5.1.6",
|
|
36
|
-
"@types/node": "^20.5.1",
|
|
37
|
-
"ts-node": "^10.9.1"
|
|
38
|
-
}
|
|
39
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "auth-events",
|
|
3
|
+
"version": "0.0.8",
|
|
4
|
+
"description": "A lightweight Node.js library to track and react to authentication events across any auth provider.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"main": "dist/index.js",
|
|
8
|
+
"types": "dist/index.d.ts",
|
|
9
|
+
"exports": {
|
|
10
|
+
".": {
|
|
11
|
+
"import": "./dist/index.js",
|
|
12
|
+
"types": "./dist/index.d.ts"
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
"files": [
|
|
16
|
+
"dist/index.js",
|
|
17
|
+
"dist/index.d.ts"
|
|
18
|
+
],
|
|
19
|
+
"author": "Meraj Ansari",
|
|
20
|
+
"keywords": [
|
|
21
|
+
"auth",
|
|
22
|
+
"authentication",
|
|
23
|
+
"sessions",
|
|
24
|
+
"events",
|
|
25
|
+
"nodejs",
|
|
26
|
+
"npm"
|
|
27
|
+
],
|
|
28
|
+
"scripts": {
|
|
29
|
+
"build": "tsup src/index.ts --format esm --dts",
|
|
30
|
+
"dev": "tsup src/index.ts --watch",
|
|
31
|
+
"prepublishOnly": "npm run build"
|
|
32
|
+
},
|
|
33
|
+
"devDependencies": {
|
|
34
|
+
"tsup": "^6.6.0",
|
|
35
|
+
"typescript": "^5.1.6",
|
|
36
|
+
"@types/node": "^20.5.1",
|
|
37
|
+
"ts-node": "^10.9.1"
|
|
38
|
+
}
|
|
39
|
+
}
|